Squirrel.windows: Squirrel --releasify finishes the command before the setup.exe and RELEASES files are copied

Created on 11 Nov 2015  路  2Comments  路  Source: Squirrel/Squirrel.Windows

I'm working on a build process that contains a call to Squirrel --releasify to automate the deployment process of my application.

I'm calling signtool on the setup.exe right after the call to releasify, and it was always telling me that he couldn't find setup.exe. After a few research, I did a simple dir on the release folder right after the call to releasify... and it returned just the .nupkg.

If I add a "wait" of ~5 seconds before the dir, the .exe and RELEASES files are there. So, it seems that the call to Squirrel --releasify is returning before it has actually ended the process, which is quite annoying when scripting.

Edit: It's actually worse than I thought, he actually returns even before the whole .nupkg are copied. I just uploaded a half-created nupkg file to my test environment...

Most helpful comment

My bad, you're completely right. I tought it was marked as a console program and would wait to finish before returning, so I was confused.

Calling it either with Start-Process with the wait flag, like so:

$squirrel_releasify_arguments = '--releasify $packageFilePath --releaseDir $releaseFolder'
Start-Process '.\packages\squirrel.windows.1.0.4\tools\Squirrel.exe' -ArgumentList $squirrel_releasify_arguments -Wait

Or, even simpler, piping the output of the call to a Write-Output (or Wait-Task) works perfectly

Set-Alias Squirrel '.\packages\squirrel.windows.1.0.4\tools\Squirrel.exe'
Squirrel --releasify $packageFilePath --releaseDir $releaseFolder | Write-Output

I think you can close the issue. Thanks for the help.

All 2 comments

Hm, I'm not so sure, we're definitely calling .Wait() on all our calls of signtool.exe. I suspect you're not correctly waiting on Squirrel.exe (which is easy to do because it's not marked as a console program, you need to wait for the PID to exit)

My bad, you're completely right. I tought it was marked as a console program and would wait to finish before returning, so I was confused.

Calling it either with Start-Process with the wait flag, like so:

$squirrel_releasify_arguments = '--releasify $packageFilePath --releaseDir $releaseFolder'
Start-Process '.\packages\squirrel.windows.1.0.4\tools\Squirrel.exe' -ArgumentList $squirrel_releasify_arguments -Wait

Or, even simpler, piping the output of the call to a Write-Output (or Wait-Task) works perfectly

Set-Alias Squirrel '.\packages\squirrel.windows.1.0.4\tools\Squirrel.exe'
Squirrel --releasify $packageFilePath --releaseDir $releaseFolder | Write-Output

I think you can close the issue. Thanks for the help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CDAGaming picture CDAGaming  路  4Comments

CodeFunta picture CodeFunta  路  6Comments

joshiji picture joshiji  路  6Comments

aneeff picture aneeff  路  5Comments

shiftkey picture shiftkey  路  4Comments