Skip to content

Commit

Permalink
use perMachine or perUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed Feb 27, 2024
1 parent 233dd2a commit 00256af
Showing 1 changed file with 60 additions and 3 deletions.
63 changes: 60 additions & 3 deletions build-win-installer/perUser.wxs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
candle.exe -o dist/ build-win-installer/perUser.wxs
light.exe -o dist/heta-compiler-win-x64-installer.msi dist/perUser.wixobj -ext WixUIExtension -ext WixUtilExtension
update code: Product/@Id, Product/@Version
perMachine: requires elevated privileges to install. Sets the ALLUSERS property to 1.
perUser: does not require elevated privileges to install. Sets the package's InstallPrivileges attribute to "limited."
-->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product
Expand All @@ -15,11 +17,13 @@ update code: Product/@Id, Product/@Version
UpgradeCode="0ab2e391-808f-481d-a423-1a64c0140b23"
Language="1033"
>
<!--
InstallPrivileges="limited"
-->
<Package
InstallerVersion="200"
Compressed="yes"
InstallScope="perUser"
InstallPrivileges="limited"
Platform="x64"
/>
<Condition Message="This application is only supported on 64-bit systems.">
Expand All @@ -43,6 +47,11 @@ update code: Product/@Id, Product/@Version
</Directory>
<!--</Directory>-->
</Directory>
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALL_HERE_ALL" Name="heta-compiler">
<Directory Id="BINFOLDER_ALL" Name="bin" />
</Directory>
</Directory>
</Directory>
</Fragment>

Expand All @@ -51,7 +60,6 @@ update code: Product/@Id, Product/@Version
<Component Id="HetCompilerRun" Guid="ba0b0d51-06a2-4f2e-b606-83ade9cb6234" Win64="yes" Directory="BINFOLDER">
<Condition>NOT ALLUSERS</Condition>
<RemoveFolder Id="RemoveInstallHere" On="uninstall" />
<!-- Define the registry key and value in HKCU to use as the KeyPath -->
<RegistryKey Root="HKCU" Key="Software\[Manufacturer]\[ProductName]\Settings">
<RegistryValue Type="string" Name="InstallationFlag" Value="Installed" KeyPath="yes"/>
</RegistryKey>
Expand Down Expand Up @@ -96,6 +104,55 @@ update code: Product/@Id, Product/@Version
Checksum="yes"
/>
</Component>

<Component Id="HetCompilerRunAll" Guid="2dbdc5d9-a3cd-4a17-a17c-c6ff5c243b59" Win64="yes" Directory="BINFOLDER_ALL">
<Condition>ALLUSERS</Condition>
<RemoveFolder Id="RemoveInstallHereAll" On="uninstall" />
<!-- Define the registry key and value in HKCU to use as the KeyPath -->
<RegistryKey Root="HKLM" Key="Software\[Manufacturer]\[ProductName]\Settings">
<RegistryValue Type="string" Name="InstallationFlag" Value="Installed" KeyPath="yes"/>
</RegistryKey>
<File
Id="HetaCompilerExeAll"
Name= "heta.exe"
Source="dist/heta-compiler-win.exe"
Checksum="yes"
/>
<Environment
Id="UpdatePathAll"
Name="Path"
Value="[BINFOLDER_ALL]"
Permanent="no"
Part="last"
Action="set"
System="yes"
/>
</Component>
<Component Id="HetCompilerDocsAll" Guid="d5f140de-988e-4c4f-955f-ab159f13f39f" Win64="yes" Directory="INSTALL_HERE_ALL">
<Condition>ALLUSERS</Condition>
<RemoveFolder Id="RemoveInstallHere2All" On="uninstall" />
<RegistryKey Root="HKLM" Key="Software\[Manufacturer]\[ProductName]\Settings">
<RegistryValue Type="string" Name="InstallationFlag" Value="Installed" KeyPath="yes"/>
</RegistryKey>
<File
Id="ReadmeMdAll"
Name= "README.md"
Source="README.md"
Checksum="yes"
/>
<File
Id="LicenseAll"
Name= "LICENSE"
Source="LICENSE"
Checksum="yes"
/>
<File
Id="ChangelogMdAll"
Name="CHANGELOG.md"
Source="CHANGELOG.md"
Checksum="yes"
/>
</Component>
</ComponentGroup>
</Fragment>
</Wix>

0 comments on commit 00256af

Please sign in to comment.