[wix-users] Persisted variable getting reinitialized

Dima Vasilkov dimvasilk at gmail.com
Wed Mar 31 14:43:51 PDT 2021


Interesting. It seems like the value is also being re-initialized for the
bootstrapper. I have a dialog box in the custom bootstrapper that shows if
there is not enough space on the install disk. In this particular case, the
main drive is C:\ and I am installing on D:\. So the installation path
should stay as D:\ after the restart, but it is still installing to
[LocalAppData] which is the default supplied in the Variable element. What
could be the issue here?

On Wed, Mar 31, 2021 at 5:36 PM Sean Hall via wix-users <
wix-users at lists.wixtoolset.org> wrote:

> You'll always see that initialization message. The value should have been
> persisted if the bundle was automatically started on reboot. When loading
> the persisted variable values, those updates are not currently logged (
>
> https://github.com/wixtoolset/wix3/blob/376423b8101f4b59ee865e8a255cfe190fa5a7f1/src/burn/engine/variable.cpp#L995
> ).
>
> On Wed, Mar 31, 2021 at 4:08 PM Dima Vasilkov via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
> > Hello,
> >
> > I have a variable, InstallFolder, that I would like to persist with a
> > restart partway through the installation. I have a default value set for
> > the variable and it is only changed if the registry key is present.
> >
> > <util:RegistrySearch
> >       Id='IsElectronInstalled'
> >       Variable="elInstalled"
> >       Result="exists"
> >       Root="HKCU"
> >       Key="Software\$(var.Branding)" />
> > <util:RegistrySearch Id="installedLocSearch" Root="HKCU"
> >       Key="SOFTWARE\$(var.Branding)" Result="value"
> >       Win64="yes" Variable="InstallFolder" Value="install_location"
> >       Condition="elInstalled" After="installedVerSearch"/>
> > <Variable Name="InstallFolder" bal:Overridable="yes" Type="string"
> > Value="[LocalAppDataFolder]" Persisted="yes"/>
> >
> > The bootstrapper successfully initializes the variable
> > [0798:078C][2021-03-31T16:44:32]i000: Initializing string variable
> > 'InstallFolder' to value '[LocalAppDataFolder]'
> >
> > and the variable that determines whether to run the registry search
> > evaluates to false
> > [0798:078C][2021-03-31T16:44:33]i000: Setting numeric variable
> > 'elInstalled' to value 0
> >
> > Then the user changes the value of the variable from the bootstrapper
> > [0798:0DF0][2021-03-31T16:45:29]i000: Setting string variable
> > 'InstallFolder' to value 'D:\'
> >
> > After the restart completes the bootstrapper resumes installation but
> says
> > [237C:2380][2021-03-31T16:48:37]i000: Initializing string variable
> > 'InstallFolder' to value '[LocalAppDataFolder]'\
> > which overwrites the value that was set before the restart :(
> >
> > Not sure if this is related but there are a bunch of messages before the
> > restart like this
> >
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to send
> > BURN_ELEVATION_MESSAGE_TYPE_CLEAN_PACKAGE message to per-machine process.
> > [0798:092C][2021-03-31T16:47:10]i400: Received system request to shut
> down
> > the process: critical: Yes, elevated: No, allowed: Yes
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to write
> > message type to pipe.
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to write
> > send message to pipe.
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to send
> > message to per-machine process.
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to end
> > session in per-machine process.
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to write
> > message type to pipe.
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to write
> > send message to pipe.
> > [0798:078C][2021-03-31T16:47:10]e000: Error 0x800700e8: Failed to send
> > message to per-machine process.
> >
> >
> > How can I get the burn variable to keep the same value despite the
> restart?
> >
> > Best,
> > Dima
> >
> > ____________________________________________________________________
> > 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