Skip to content

Commit 12c3fa0

Browse files
committed
update wix installer config
1 parent aa4774f commit 12c3fa0

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎installer-config/installer.wxs‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@
106106
<Directory Id="ProgramMenuFolder">
107107
<Directory Id="ApplicationProgramsFolder" Name="{{product_name}}"/>
108108
</Directory>
109+
110+
<Component Id="PathEnvPerMachine" Guid="*">
111+
<Condition>ALLUSERS=1 OR (ALLUSERS=2 AND Privileged)</Condition>
112+
<RegistryValue Root="HKLM" Key="Software\[Manufacturer]\[ProductName]" Name="InstallDir" Type="string" Value="[APPLICATIONFOLDER]" KeyPath="yes" />
113+
<!-- [APPLICATIONFOLDER] contains trailing backslash -->
114+
<Environment Id="PathPerMachine" Name="PATH" Value="[APPLICATIONFOLDER]bin" Permanent="no" Part="last" Action="set" System="yes" />
115+
</Component>
116+
<Component Id="PathEnvPerUser" Guid="*">
117+
<Condition>ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged))</Condition>
118+
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[ProductName]" Name="InstallDir" Type="string" Value="[APPLICATIONFOLDER]" KeyPath="yes" />
119+
<Environment Id="PathPerUser" Name="PATH" Value="[APPLICATIONFOLDER]bin" Permanent="no" Part="last" Action="set" System="no" />
120+
</Component>
109121
</Directory>
110122

111123
<DirectoryRef Id="INSTALLDIR">
@@ -207,7 +219,6 @@
207219
{{#each resource_file_ids as |resource_file_id| ~}}
208220
<ComponentRef Id="{{ resource_file_id }}"/>
209221
{{/each~}}
210-
211222
<Feature Id="ShortcutsFeature"
212223
Title="Shortcuts"
213224
Level="1">
@@ -230,6 +241,15 @@
230241
</Feature>
231242
</Feature>
232243

244+
<Feature Id="Path"
245+
Title="Add to PATH"
246+
Description="Add to PATH environment variable"
247+
Level="1"
248+
AllowAdvertise="no">
249+
<ComponentRef Id="PathEnvPerMachine" />
250+
<ComponentRef Id="PathEnvPerUser" />
251+
</Feature>
252+
233253
<Feature Id="External" AllowAdvertise="no" Absent="disallow">
234254
{{#each component_group_refs as |id| ~}}
235255
<ComponentGroupRef Id="{{ id }}"/>

0 commit comments

Comments
 (0)