polaris/build_release_windows.ps1

45 lines
2 KiB
PowerShell
Raw Normal View History

Get-ChildItem "Cargo.toml" | % {
$conf = $_ | Get-Content -raw
$conf -match 'version\s+=\s+"(.*)"' | out-null
$POLARIS_VERSION = $matches[1]
}
"Compiling resource file"
2016-09-26 00:18:11 +00:00
RC /fo res\windows\application\application.res res\windows\application\application.rc
""
"Compiling executable"
2016-09-26 00:18:11 +00:00
cargo rustc --release --features "ui" -- -C link-args="/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup res\windows\application\application.res"
""
"Creating output directory"
New-Item .\release\tmp -type directory -Force | Out-Null
Remove-Item -Recurse .\release\tmp\*
""
"Copying to output directory"
2016-09-26 00:18:11 +00:00
Copy-Item .\res\windows\installer\license.rtf .\release\tmp\
Copy-Item .\res\windows\installer\banner.bmp .\release\tmp\
Copy-Item .\res\windows\installer\dialog.bmp .\release\tmp\
2017-07-08 19:41:18 +00:00
Copy-Item .\target\release\polaris.exe .\release\tmp\
Copy-Item .\web\img .\release\tmp\web\img -recurse
Copy-Item .\web\js .\release\tmp\web\js -recurse
Copy-Item .\web\lib .\release\tmp\web\lib -recurse
Copy-Item .\web\style .\release\tmp\web\style -recurse
Copy-Item .\web\tags .\release\tmp\web\tags -recurse
Copy-Item .\web\favicon.png .\release\tmp\web\
Copy-Item .\web\index.html .\release\tmp\web\
""
"Creating installer"
heat dir .\release\tmp\web\ -ag -g1 -dr AppDataPolaris -cg WebUI -sfrag -var wix.WebUIDir -out .\release\tmp\web_ui_fragment.wxs
candle -wx -ext WixUtilExtension -arch x64 -out .\release\tmp\web_ui_fragment.wixobj .\release\tmp\web_ui_fragment.wxs
candle -wx -ext WixUtilExtension -arch x64 -out .\release\tmp\installer.wixobj .\res\windows\installer\installer.wxs
light -dWebUIDir=".\release\tmp\web" -wx -ext WixUtilExtension -ext WixUIExtension -spdb -sw1076 -sice:ICE38 -sice:ICE64 -out .\release\Polaris_$POLARIS_VERSION.msi .\release\tmp\installer.wixobj .\release\tmp\web_ui_fragment.wixobj
"Cleaning up"
Remove-Item -Recurse .\release\tmp
""
Read-Host -Prompt "All clear! Press Enter to exit"