Skip to content

Commit

Permalink
set perMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
metelkin committed Jan 10, 2025
1 parent b9f79c9 commit 1e2d3f4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ jobs:
id: package_version
run: | # deprecated
$version = node -p "require('./package.json').version"
echo "::set-output name=VERSION::$version"
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Install WiX Toolset
run: |
Expand All @@ -145,7 +145,7 @@ jobs:
id: new_guid
run: | # deprecated
$guid = [guid]::NewGuid().ToString().ToUpper()
echo "::set-output name=NewGUID::$guid"
echo "NewGUID=$guid" >> $env:GITHUB_OUTPUT
- name: Update .wxs file with new Product Id
run: |
echo "GUID: ${{ steps.new_guid.outputs.NewGUID }}"
Expand Down
26 changes: 26 additions & 0 deletions build-win-installer/manual-build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# install wix from PowerShell with admin rights
choco install wixtoolset

# build .exe file for windows
npx pkg . -t win --compress GZip
cp -Force dist/heta-compiler.exe dist/heta-compiler-win-x64.exe

# get version
$version = node -p "require('./package.json').version"
$VERSION = $version

# get new id
$guid = [guid]::NewGuid().ToString()
$NewGUID = $guid

# update version and id in .wxs file
echo "GUID: $NewGUID"
$pathToWxs = "build-win-installer/perUser.wxs"
$content = Get-Content $pathToWxs -Raw
$newContent1 = $content -replace '(?<=Product\s+Id=")[^"]*', "$NewGUID"
$newContent2 = $newContent1 -replace '(?<=Version\s*=\s*")0\.0\.0', "$VERSION"
$newContent2 | Set-Content $pathToWxs

# build .msi file for windows
& ${env:WIX}bin\candle.exe -o dist/ build-win-installer/perUser.wxs
& ${env:WIX}bin\light.exe -o dist/heta-compiler-win-x64-installer.msi dist/perUser.wixobj -ext WixUIExtension
2 changes: 1 addition & 1 deletion build-win-installer/perUser.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ perUser: does not require elevated privileges to install. Sets the package's Ins
<Package
InstallerVersion="200"
Compressed="yes"
InstallScope="perUser"
InstallScope="perMachine"
Platform="x64"
/>
<Condition Message="This application is only supported on 64-bit systems.">
Expand Down

0 comments on commit 1e2d3f4

Please sign in to comment.