forked from Squirrel/Squirrel.Windows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PS script for electron-winstaller packaging
- Loading branch information
1 parent
05d2745
commit ff3dd35
Showing
1 changed file
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<# | ||
Package script for electron-winstaller | ||
The NPM package electron-winstaller allows developers to | ||
build Windows installers for Electron apps using Squirrel | ||
(https://github.com/electron/windows-installer) | ||
This script copies the required files into a single folder | ||
which can then be copied to the electron-winstaller/vendor folder | ||
(either manually or in an automated way). | ||
#> | ||
|
||
# Stop the script if an error occurs | ||
$ErrorActionPreference = "Stop" | ||
$In = ".\build\Release\" | ||
$Out = ".\build\electron-winstaller\" | ||
$Folders = @("./build", "./packages", "./test/bin", "./test/obj") | ||
|
||
# Ensure a clean state by removing build/package folders | ||
foreach ($Folder in $Folders) { | ||
if (Test-Path $Folder) { | ||
Remove-Item -path $Folder -Recurse -Force | ||
} | ||
} | ||
|
||
# Build Squirrel | ||
git submodule update --init --recursive | ||
.\.NuGet\NuGet.exe restore | ||
msbuild /p:Configuration=Release | ||
|
||
# Create the electron-winstaller folder | ||
New-Item -Path $Out -ItemType "directory" | Out-Null | ||
|
||
# Copy over all files we need | ||
Copy-Item "$In\net45\Update.exe" -Destination "$Out\Squirrel.exe" | ||
Copy-Item "$In\net45\update.com" -Destination "$Out\Squirrel.com" | ||
Copy-Item "$In\net45\Update.pdb" -Destination "$Out\Squirrel.pdb" | ||
Copy-Item "$In\Win32\Setup.exe" -Destination $Out | ||
Copy-Item "$In\Win32\Setup.pdb" -Destination $Out | ||
Copy-Item "$In\net45\Update-Mono.exe" -Destination "$Out\Squirrel-Mono.exe" | ||
Copy-Item "$In\net45\Update-Mono.pdb" -Destination "$Out\Squirrel-Mono.pdb" | ||
Copy-Item "$In\Win32\StubExecutable.exe" -Destination $Out | ||
Copy-Item "$In\net45\SyncReleases.exe" -Destination $Out | ||
Copy-Item "$In\net45\SyncReleases.pdb" -Destination $Out | ||
Copy-Item "$In\Win32\WriteZipToSetup.exe" -Destination $Out | ||
Copy-Item "$In\Win32\WriteZipToSetup.pdb" -Destination $Out | ||
|
||
Write-Output "Successfully copied files for electron-winstaller to build/electron-winstaller." |