Skip to content

Commit

Permalink
windows: backup and restore registry with update install
Browse files Browse the repository at this point in the history
Signed-off-by: Shizuo Fujita <[email protected]>
  • Loading branch information
Watson1978 committed Jan 29, 2025
1 parent 5742729 commit 75fb559
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions fluent-package/msi/source.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,31 @@
Return="check"
Impersonate="no" />

<Property Id="BackupRegistryKey" Value=" "/>
<CustomAction Id="SetBackupRegistryKeyCommand"
Property="BackupRegistryKey"
Value="&quot;cmd&quot; /c &quot;chcp 437 &amp;&amp; reg export HKLM\SYSTEM\CurrentControlSet\Services\fluentdwinsvc C:/fluentdwinsvc.reg&quot;"/>
<CustomAction Id="BackupRegistryKey"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Execute="deferred"
Return="ignore"
Impersonate="no" />
<Property Id="RestoreRegistryKey" Value=" "/>
<CustomAction Id="SetRestoreRegistryKeyCommand"
Property="RestoreRegistryKey"
Value="&quot;cmd&quot; /c &quot;reg import C:/fluentdwinsvc.reg&quot;"/>
<CustomAction Id="RestoreRegistryKey"
BinaryKey="WixCA"
DllEntry="WixQuietExec64"
Execute="deferred"
Return="ignore"
Impersonate="no" />

<InstallExecuteSequence>
<Custom Action="SetBackupRegistryKeyCommand" Before="BackupRegistryKey">REMOVE="ALL"</Custom>
<Custom Action="BackupRegistryKey" Before="StopServices">REMOVE="ALL"</Custom>

<Custom Action="SetPostInstallCommand" After="InstallFiles">NOT Installed</Custom>
<Custom Action="PostInstall" After="SetPostInstallCommand">NOT Installed</Custom>

Expand All @@ -245,6 +269,9 @@
<Custom Action="SetInstallFluentdWinSvcCommand" After="InstallFiles">NOT Installed</Custom>
<Custom Action="InstallFluentdWinSvc" After="SetInstallFluentdWinSvcCommand">NOT Installed</Custom>

<Custom Action="SetRestoreRegistryKeyCommand" After="InstallFluentdWinSvc">NOT Installed</Custom>
<Custom Action="RestoreRegistryKey" After="SetRestoreRegistryKeyCommand">NOT Installed</Custom>

<Custom Action="SetCreateCompatTdAgentBat" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="CreateCompatTdAgentBat" After="SetCreateCompatTdAgentBat">NOT Installed</Custom>
<Custom Action="SetCreateCompatTdAgentGemBat" Before="InstallFinalize">NOT Installed</Custom>
Expand Down

0 comments on commit 75fb559

Please sign in to comment.