Skip to content

Commit

Permalink
add CLEAN option for doing a clean manager install
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryFissionGames committed Oct 11, 2024
1 parent 0c697e1 commit acc5cb9
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions windows/templates/product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
<RegistrySearch Id='LOADINSTALLDIROLD' Type='raw'
Root='HKLM' Key='Software\Microsoft\Windows\CurrentVersion\Uninstall\observIQ OpenTelemetry Collector' Name='InstallLocation' />
</Property>

<Property Id="MANAGEREXISTS">
<DirectorySearch Id="CheckInstallDir" Path="INSTALLDIR" Depth="0">
<FileSearch Id="FindManager" Name="manager.yaml" />
</DirectorySearch>
</Property>


<!-- Set default install dir to be "C:\Program Files\observIQ OpenTelemetry Collector" instead of "C:\Program Files\[ProductName]"-->
<SetProperty Id="INSTALLDIR" Value="[$(var.Program_Files)]\observIQ OpenTelemetry Collector" Before="CostInitialize">
Expand Down Expand Up @@ -208,13 +215,6 @@

<CustomAction Id="CustomExecCreateManagerYaml" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no" Return="check" />

<CustomAction Id="CustomExecRemoveManagerYaml_set"
Property="CustomExecRemoveManagerYaml"
Value="&quot;[CMDEXE]&quot; /C del &quot;[INSTALLDIR]manager.yaml&quot;"
Execute="immediate"/>

<CustomAction Id="CustomExecRemoveManagerYaml" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Impersonate="no" Return="ignore" />

<InstallExecuteSequence>
{{range $i, $h := .Hooks}}
<Custom Action="CustomExec{{$i}}" {{if eq $h.When "install"}} After="InstallFiles" {{else if eq $h.Execute "immediate"}} Before="InstallValidate" {{else}} After="InstallInitialize" {{end}}>
Expand All @@ -234,12 +234,11 @@

<!-- Schedule the action that creates the manager.yaml file on initial install -->
<Custom Action="CustomExecCreateManagerYaml_set" After="InstallInitialize" >
<![CDATA[(VersionNT >= 603 OR VersionNT64 >= 603) AND NOT Installed AND NOT REMOVE AND ENABLEMANAGEMENT AND NOT WIX_UPGRADE_DETECTED]]>
<![CDATA[(VersionNT >= 603 OR VersionNT64 >= 603) AND NOT Installed AND NOT REMOVE AND ENABLEMANAGEMENT AND NOT WIX_UPGRADE_DETECTED AND (not MANAGEREXISTS or CLEAN)]]>
</Custom>
<Custom Action="CustomExecCreateManagerYaml" After="InstallFiles" >
<![CDATA[(VersionNT >= 603 OR VersionNT64 >= 603) AND NOT Installed AND NOT REMOVE AND ENABLEMANAGEMENT AND NOT WIX_UPGRADE_DETECTED]]>
<![CDATA[(VersionNT >= 603 OR VersionNT64 >= 603) AND NOT Installed AND NOT REMOVE AND ENABLEMANAGEMENT AND NOT WIX_UPGRADE_DETECTED AND (not MANAGEREXISTS or CLEAN)]]>
</Custom>

</InstallExecuteSequence>

<Feature Id="DefaultFeature" Level="1">
Expand Down

0 comments on commit acc5cb9

Please sign in to comment.