Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Squirrel --releasify finishes the command before the setup.exe and RELEASES files are copied #489

Closed
Gimly opened this issue Nov 11, 2015 · 4 comments

Comments

@Gimly
Copy link

Gimly commented Nov 11, 2015

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...

@anaisbetts
Copy link
Contributor

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)

@Gimly
Copy link
Author

Gimly commented Nov 12, 2015

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.

@UnnecessaryPunctuation
Copy link

Does | Write-Output still work on the lastest version?

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

@caesay
Copy link

caesay commented Apr 12, 2022

Worth mentioning that my fork is available here and has dozens+ of fixes and improvements. One of them being that Squirrel.exe is now properly a console app, and this workaround is no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants