[wix-users] WiX fails to launch the installer when previous launch was from a removable drive

Mayooran Macilamany mayooran99 at gmail.com
Tue May 30 08:55:21 PDT 2017


I have a log entry mentioning the location where this file is to be
written. Its referring to a drive that doesn't exist, which is E:\ drive.
As I said, this failure is happening when I run the first installation from
a removable disk. So when I try to update this removable disk installation
with another installer that is inside the local disk, its crashing and the
first mail I sent contains the event viewer log. So the bottomline is that
this happens during an update, when the first installation was done from a
removable disk. The last log entry mentions the location to write this
result file. That means, it crashed since this location points to a
non-existing location. But why does it point to a non existing location?
Yes I ran the 1st installation from a removable disk, but the current
update I am trying to do is from a local disk. Should this not point to
this local disk as its log writing location? This is super confusing.

On Tue, May 30, 2017 at 8:56 PM, Hoover, Jacob <Jacob.Hoover at greenheck.com>
wrote:

> The BA should be defending against bad/missing/malformed variables and not
> just blindly write a log file to a path in a variable.  You are assuming
> that the path where the installer started was writable, always available,
> and that you actually have permission to write to it.
>
> That being said, what do the logs in your temp folder show?  When is the
> failure happening? What does the code near this code look like?
>
>
> -----Original Message-----
> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf
> Of Mayooran Macilamany
> Sent: Tuesday, May 30, 2017 10:10 AM
> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
> Subject: Re: [wix-users] WiX fails to launch the installer when previous
> launch was from a removable drive
>
> Below is how I am writing to the file from my custom BA class.
>
>                string launchedFolder =
> Path.GetDirectoryName(this.Engine.FormatString(this.
> Engine.StringVariables["OriginalLocation"]));
>                File.WriteAllText(launchedFolder + "\\exec_result.txt",
> "fail=Update failed: " + "Product Already Installed.");
>
> Above variable original location is set in the Bundle.wxs file of the boot
> strapper as shown below.
>
>               <Variable Name="OriginalLocation" Type="string"
> Value="[WixBundleOriginalSource]" bal:Overridable="yes"/>
>
> I tried attaching the device again, before running the install from the
> local drive. Still getting the same error. Any clues?
>
> On Tue, May 30, 2017 at 7:37 PM, Tyler Gustafson <tgustafson at solacom.com>
> wrote:
>
> > How are you writing to the file in the current directory? What happens
> > if you attach the removable disk before running the install from the
> > local drive?
> > ________________________________
> > From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of
> > Mayooran Macilamany <mayooran99 at gmail.com>
> > Sent: May 30, 2017 9:36:42 AM
> > To: WiX Toolset Users Mailing List
> > Subject: [wix-users] WiX fails to launch the installer when previous
> > launch was from a removable drive
> >
> > Hi all,
> >
> > Say I install my managed bootstrapper burn installer from a removable
> disk.
> > This installs fine. But the next time I try to install/update this
> > from a local drive, the update/install process fails. The installer UI
> > crashes when I double click on it to launch the installer. Why is this
> happening?
> > If the previous installation was from a local disk, then
> > update/install works fine. Why is this happening? Below is what I have
> > found in the event logs.
> >
> > Please note that I am writing to a file about the installation status,
> > from the directory in which the installer is launched from. Could this
> > be causing the issue? But why would this be an issue since now the
> > launched directory is the local drive and its only the previous
> > version installation that happened from an external disk.
> >
> > Any help would be much appreciated.
> >
> > Application: BasePlatformSetup.exe
> > Framework Version: v4.0.30319
> > Description: The process was terminated due to an unhandled exception.
> > Exception Info: System.IO.DirectoryNotFoundException
> >    at System.IO.__Error.WinIOError(Int32, System.String)
> >    at System.IO.FileStream.Init(System.String, System.IO.FileMode,
> > System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32,
> > System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean,
> > Boolean, Boolean)
> >    at System.IO.FileStream..ctor(System.String, System.IO.FileMode,
> > System.IO.FileAccess, System.IO.FileShare, Int32,
> > System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
> >    at System.IO.StreamWriter.CreateFile(System.String, Boolean, Boolean)
> >    at System.IO.StreamWriter..ctor(System.String, Boolean,
> > System.Text.Encoding, Int32, Boolean)
> >    at System.IO.File.InternalWriteAllText(System.String,
> > System.String, System.Text.Encoding, Boolean)
> >    at System.IO.File.WriteAllText(System.String, System.String)
> >    at CustomBA.CustomBA.Run()
> >    at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
> >    at
> > System.Threading.ExecutionContext.RunInternal(System.Threading.
> > ExecutionContext,
> > System.Threading.ContextCallback, System.Object, Boolean)
> >    at
> > System.Threading.ExecutionContext.Run(System.Threading.ExecutionContex
> > t, System.Threading.ContextCallback, System.Object, Boolean)
> >    at
> > System.Threading.ExecutionContext.Run(System.Threading.ExecutionContex
> > t, System.Threading.ContextCallback, System.Object)
> >    at System.Threading.ThreadHelper.ThreadStart()
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
> > ____________________________________________________________________
> > WiX Toolset Users Mailing List provided by FireGiant
> > http://www.firegiant.com/
> >
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>
> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/
>


More information about the wix-users mailing list