Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: ./test/test_official.cmd

- name: Save build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: artifacts
path: build/artifacts/
10 changes: 9 additions & 1 deletion src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,12 +632,20 @@ bool isPEFileSigned(string path)

async Task createExecutableStubForExe(string fullName)
{
var exe = Utility.FindHelperExecutable(@"StubExecutable.exe");
if(fullName.EndsWith("_ExecutionStub.exe")) {
return;
}

var target = Path.Combine(
Path.GetDirectoryName(fullName),
Path.GetFileNameWithoutExtension(fullName) + "_ExecutionStub.exe");

// Return early if the target already exists
if (File.Exists(target)) {
return;
}

var exe = Utility.FindHelperExecutable(@"StubExecutable.exe");
await Utility.CopyToAsync(exe, target);

await Utility.InvokeProcessAsync(
Expand Down
172 changes: 86 additions & 86 deletions src/build_official.cmd
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be entirely whitespace changes, is that intentional?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I changed \r to \r\n because it was causing errors on my machine.

The system cannot find the batch label specified - StartDeveloperCommandPrompt.

However, since it works fine on GitHub Actions, I reverted the change.

Original file line number Diff line number Diff line change
@@ -1,86 +1,86 @@
@echo off

setlocal
pushd %~dp0

:parse_args
if not "%1"=="" shift & goto parse_args

:: Init

if "%VCToolsVersion%"=="" call :StartDeveloperCommandPrompt || exit /b


:: Clean

rd /s /q ..\build ..\packages 2> nul


:: Build

nuget restore ..\Squirrel.sln || exit /b

msbuild -Restore ..\Squirrel.sln -p:Configuration=Release -v:m -m -nr:false -bl:..\build\logs\build.binlog || exit /b


:: Pack .nupkg

nuget pack Squirrel.nuspec -OutputDirectory ..\build\artifacts || exit /b


:: Layout electron-winstaller
::
:: The NPM package electron-winstaller allows developers to
:: build Windows installers for Electron apps using Squirrel
:: (https://github.com/electron/windows-installer)
::
:: The following 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).

md ..\build\artifacts\electron-winstaller\vendor

copy ..\build\Release\net45\Update.exe ..\build\artifacts\electron-winstaller\vendor\Squirrel.exe || exit /b
copy ..\build\Release\net45\update.com ..\build\artifacts\electron-winstaller\vendor\Squirrel.com || exit /b
copy ..\build\Release\net45\Update.pdb ..\build\artifacts\electron-winstaller\vendor\Squirrel.pdb || exit /b
copy ..\build\Release\Win32\Setup.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\Win32\Setup.pdb ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\net45\Update-Mono.exe ..\build\artifacts\electron-winstaller\vendor\Squirrel-Mono.exe || exit /b
copy ..\build\Release\net45\Update-Mono.pdb ..\build\artifacts\electron-winstaller\vendor\Squirrel-Mono.pdb || exit /b
copy ..\build\Release\Win32\StubExecutable.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\net45\SyncReleases.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\net45\SyncReleases.pdb ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\Win32\WriteZipToSetup.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\Win32\WriteZipToSetup.pdb ..\build\artifacts\electron-winstaller\vendor || exit /b


goto LExit

:StartDeveloperCommandPrompt
if not "%SquirrelSkipVsDevCmd%"=="" (
echo Skipping initializing developer command prompt
exit /b
)

echo Initializing developer command prompt

if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
exit /b 2
)

for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [16.0^,18.0^) -property installationPath`) do (
if exist "%%i\Common7\Tools\vsdevcmd.bat" (
call "%%i\Common7\Tools\vsdevcmd.bat" -no_logo
exit /b
)
echo developer command prompt not found in %%i
)

echo No versions of developer command prompt found
exit /b 2

:LExit

popd
endlocal
@echo off
setlocal
pushd %~dp0
:parse_args
if not "%1"=="" shift & goto parse_args
:: Init
if "%VCToolsVersion%"=="" call :StartDeveloperCommandPrompt || exit /b
:: Clean
rd /s /q ..\build ..\packages 2> nul
:: Build
nuget restore ..\Squirrel.sln || exit /b
msbuild -Restore ..\Squirrel.sln -p:Configuration=Release -v:m -m -nr:false -bl:..\build\logs\build.binlog || exit /b
:: Pack .nupkg
nuget pack Squirrel.nuspec -OutputDirectory ..\build\artifacts || exit /b
:: Layout electron-winstaller
::
:: The NPM package electron-winstaller allows developers to
:: build Windows installers for Electron apps using Squirrel
:: (https://github.com/electron/windows-installer)
::
:: The following 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).
md ..\build\artifacts\electron-winstaller\vendor
copy ..\build\Release\net45\Update.exe ..\build\artifacts\electron-winstaller\vendor\Squirrel.exe || exit /b
copy ..\build\Release\net45\update.com ..\build\artifacts\electron-winstaller\vendor\Squirrel.com || exit /b
copy ..\build\Release\net45\Update.pdb ..\build\artifacts\electron-winstaller\vendor\Squirrel.pdb || exit /b
copy ..\build\Release\Win32\Setup.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\Win32\Setup.pdb ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\net45\Update-Mono.exe ..\build\artifacts\electron-winstaller\vendor\Squirrel-Mono.exe || exit /b
copy ..\build\Release\net45\Update-Mono.pdb ..\build\artifacts\electron-winstaller\vendor\Squirrel-Mono.pdb || exit /b
copy ..\build\Release\Win32\StubExecutable.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\net45\SyncReleases.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\net45\SyncReleases.pdb ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\Win32\WriteZipToSetup.exe ..\build\artifacts\electron-winstaller\vendor || exit /b
copy ..\build\Release\Win32\WriteZipToSetup.pdb ..\build\artifacts\electron-winstaller\vendor || exit /b
goto LExit
:StartDeveloperCommandPrompt
if not "%SquirrelSkipVsDevCmd%"=="" (
echo Skipping initializing developer command prompt
exit /b
)
echo Initializing developer command prompt
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
exit /b 2
)
for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [16.0^,18.0^) -property installationPath`) do (
if exist "%%i\Common7\Tools\vsdevcmd.bat" (
call "%%i\Common7\Tools\vsdevcmd.bat" -no_logo
exit /b
)
echo developer command prompt not found in %%i
)
echo No versions of developer command prompt found
exit /b 2
:LExit
popd
endlocal