2017-06-04 21:04:45 +00:00
|
|
|
Get-ChildItem "Cargo.toml" | % {
|
|
|
|
$conf = $_ | Get-Content -raw
|
|
|
|
$conf -match 'version\s+=\s+"(.*)"' | out-null
|
|
|
|
$POLARIS_VERSION = $matches[1]
|
|
|
|
}
|
|
|
|
|
2016-09-17 10:05:31 +00:00
|
|
|
"Compiling resource file"
|
2016-09-26 00:18:11 +00:00
|
|
|
RC /fo res\windows\application\application.res res\windows\application\application.rc
|
2016-09-17 10:05:31 +00:00
|
|
|
|
2016-09-25 22:16:30 +00:00
|
|
|
""
|
2016-09-17 10:05:31 +00:00
|
|
|
"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"
|
2016-09-17 10:05:31 +00:00
|
|
|
|
2016-09-25 22:16:30 +00:00
|
|
|
""
|
2016-09-17 10:05:31 +00:00
|
|
|
"Creating output directory"
|
2016-09-25 22:22:56 +00:00
|
|
|
New-Item .\release\tmp -type directory -Force | Out-Null
|
|
|
|
Remove-Item -Recurse .\release\tmp\*
|
2016-09-17 10:05:31 +00:00
|
|
|
|
2016-09-25 22:16:30 +00:00
|
|
|
""
|
2016-09-17 10:05:31 +00:00
|
|
|
"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\
|
|
|
|
Copy-Item .\target\release\polaris.exe .\release\tmp\
|
|
|
|
Copy-Item .\res\default_config.toml .\release\tmp\polaris.toml
|
|
|
|
Copy-Item .\web\ .\release\tmp\ -recurse
|
2016-09-17 10:05:31 +00:00
|
|
|
|
2016-09-25 22:16:30 +00:00
|
|
|
""
|
|
|
|
"Creating installer"
|
2017-06-04 21:04:45 +00:00
|
|
|
candle -wx -ext WixUtilExtension -arch x64 -out .\release\tmp\installer.wixobj .\res\windows\installer\installer.wxs
|
|
|
|
light -wx -ext WixUtilExtension -ext WixUIExtension -spdb -sw1076 -out .\release\Polaris_$POLARIS_VERSION.msi .\release\tmp\installer.wixobj
|
2016-09-25 22:22:56 +00:00
|
|
|
|
|
|
|
"Cleaning up"
|
|
|
|
Remove-Item -Recurse .\release\tmp
|
2016-09-25 22:16:30 +00:00
|
|
|
|
|
|
|
""
|
2016-09-17 10:05:31 +00:00
|
|
|
Read-Host -Prompt "All clear! Press Enter to exit"
|