-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters