[wix-users] Persisted variable getting reinitialized

Dima Vasilkov dimvasilk at gmail.com
Wed Mar 31 14:08:02 PDT 2021


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


More information about the wix-users mailing list