mirror of
https://github.com/fleetdm/fleet
synced 2026-05-21 16:08:47 +00:00
Removing orbit files using MSI installer custom actions (#9362)
Adding powershell custom action on WIX installer to remove Orbit folder during product uninstall
This commit is contained in:
parent
41f89365dd
commit
86c1916989
2 changed files with 6 additions and 10 deletions
1
orbit/changes/bug-3563-uninstall-does-not-remove-files
Normal file
1
orbit/changes/bug-3563-uninstall-does-not-remove-files
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Windows MSI installer now uses custom actions to remove Orbit files
|
||||
|
|
@ -53,10 +53,6 @@ var windowsWixTemplate = template.Must(template.New("").Option("missingkey=error
|
|||
<PermissionEx Sddl="O:SYG:SYD:P(A;OICI;FA;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)" />
|
||||
</CreateFolder>
|
||||
</Component>
|
||||
<Component Id="C_ORBITROOT_REMOVAL" Guid="B7DFD19E-3D2B-4536-A04F-5D4DE90F3863">
|
||||
<RegistryValue Root="HKLM" Key="SOFTWARE\FleetDM\Orbit" Name="Path" Type="string" Value="[ORBITROOT]" KeyPath="yes" />
|
||||
<util:RemoveFolderEx On="uninstall" Property="APPLICATIONFOLDER" />
|
||||
</Component>
|
||||
<Directory Id="ORBITBIN" Name="bin">
|
||||
<Directory Id="ORBITBINORBIT" Name="orbit">
|
||||
<Component Id="C_ORBITBIN" Guid="AF347B4E-B84B-4DD4-9C4D-133BE17B613D">
|
||||
|
|
@ -115,12 +111,12 @@ var windowsWixTemplate = template.Must(template.New("").Option("missingkey=error
|
|||
Return="check"
|
||||
Impersonate="no" />
|
||||
|
||||
<SetProperty Id="CA_StopOrbit"
|
||||
Before ="CA_StopOrbit"
|
||||
<SetProperty Id="CA_RemoveOrbit"
|
||||
Before ="CA_RemoveOrbit"
|
||||
Sequence="execute"
|
||||
Value='"[POWERSHELLEXE]" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "[ORBITROOT]installer_utils.ps1" -stopOrbit' />
|
||||
Value='"[POWERSHELLEXE]" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "[ORBITROOT]installer_utils.ps1" -uninstallOrbit' />
|
||||
|
||||
<CustomAction Id="CA_StopOrbit"
|
||||
<CustomAction Id="CA_RemoveOrbit"
|
||||
BinaryKey="WixCA"
|
||||
DllEntry="WixQuietExec64"
|
||||
Execute="deferred"
|
||||
|
|
@ -128,13 +124,12 @@ var windowsWixTemplate = template.Must(template.New("").Option("missingkey=error
|
|||
Impersonate="no" />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action='CA_StopOrbit' Before='RemoveFiles'>(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom> <!-- Only happens during uninstall -->
|
||||
<Custom Action='CA_RemoveOrbit' Before='RemoveFiles'>(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom> <!-- Only happens during uninstall -->
|
||||
<Custom Action='CA_UninstallOsquery' After='InstallFiles'>NOT Installed AND NOT WIX_UPGRADE_DETECTED</Custom> <!-- Only happens during first install -->
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Feature Id="Orbit" Title="Fleet osquery" Level="1" Display="hidden">
|
||||
<ComponentGroupRef Id="OrbitFiles" />
|
||||
<ComponentRef Id="C_ORBITROOT_REMOVAL" />
|
||||
<ComponentRef Id="C_ORBITBIN" />
|
||||
<ComponentRef Id="C_ORBITROOT" />
|
||||
</Feature>
|
||||
|
|
|
|||
Loading…
Reference in a new issue