Skip to content

Commit

Permalink
Add PS script for electron-winstaller packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisameling authored and robmen committed Aug 8, 2020
1 parent 05d2745 commit ff3dd35
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions package-electron-winstaller.ps1
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."

0 comments on commit ff3dd35

Please sign in to comment.