-
Notifications
You must be signed in to change notification settings - Fork 17
Switch From .exe Shim To Batch File #23
Comments
Chocolatey auto-generates those shims, nothing in the Atom chocolatey install explicitly creates them. I believe the shim issues are being fixed in the next chocolatey release. https://github.com/chocolatey/chocolatey/blob/master/CHANGELOG.md#09826-unreleased I explored adding |
It's OK if atom.exe is still there - at least for specs, we can still specify a full path to the .bat file. I have confirmed it works if both .bat and .exe files exist in the |
Yeah, it would work for specs but still fail for people trying to run |
Let me install the pre-release bits like @ferventcoder (hey!, weird, we're not talking in https://github.com/joefitzgerald/packer-windows) suggested in the issue and see if that works around the issue temporarily. |
So the folder issue is fixed. I think the issue with specs is that the |
The shims that open GUI's immediately exit. Almost all of the time people want their shell back once they've opened a GUI app. |
I'm guessing we can add an option --shimgen--waitforexit to force waiting for exit |
@ferventcoder that would be perfect - or alternatively allow that to be an option passed to the shim directly. |
Another alternative would be to generate .bat equivalents for .exe shims - as these already exhibit the correct behavior. |
That's what I'm talking about. Try this if you are on the prerelease : |
I don't think that is true, any time the shim/bat was a GUI reference, it immediately gave the shell back. Anytime it's a command line app, it waited for exit. This has been a long time way of working for chocolatey, even with .bats. |
OK - this may be a function of the fact that the So yeah, maybe it is better to focus on making the .exe wait. |
@ferventcoder |
Added it to the original ticket. |
Also pushed alpha2 for you to give this a shot and see if it resolves your issue. |
Issues installing now:
|
@ferventcoder more detail: https://gist.github.com/joefitzgerald/67eeac2aeef293981a9c Contents of
|
Could be running from a non-administrative process, with the new install location it requires administrative shells. |
This could be the posh v3+ from cmd.exe issue that we just fixed - chocolatey-archive/chocolatey#516 |
Install the new release and let's see if it fixes the issue. Let's also make sure you don't have anything holding a lock on the target folder (Lockhunter is a good tool to install for this). I didn't have errors running this so I pushed the new release. |
Rebooted after install to v0.9.8.26: https://gist.github.com/joefitzgerald/cc038da8ecf194e211b1 Still no dice. A rather cryptic error. |
Check the file |
It's not there. Also, chocolatey moves that directory to |
Not there in the lib-bad directory either? |
In neither location. |
Yes, this is very cryptic. |
|
I wonder if this is an issue with 7-zip? |
Hmmm..... |
Nevermind... removing the space between -o and " fixes it. |
It does look like the files are extracted when you inspect the tools directory ( |
Run this for me powershell
$host.version |
|
|
I think it's the specific change in wait-process causing issues. |
just reproduced it in Posh v4. |
Going to yank 0.9.8.26 for now. |
Interestingly, the AppVeyor build is not affected (although I have to update it to use the shim and the new Chocolatey version): https://ci.appveyor.com/project/joefitzgerald/go-plus/build/1.0.36 Perhaps I should update Packer-Windows to install a newer version of PowerShell... |
It's definitely the new wait-process. We need to be a little smarter around that, but it's going to need to wait until later today or tomorrow. Family day... |
The smoke tests unfortunately didn't catch this. |
@joefitzgerald I'm pushing 0.9.8.27-beta1 in a few moments. Can you give me the thumbs up on that? If it works for you, I will release today. |
I just pushed it. Please let me know if you can check that out today. If not, no worries, I'm pretty confident that the issue has been resolved. |
Will get to this in a few hours, and I'll report back soon after. Thanks!! |
@ferventcoder OK the Atom install succeeded, but the extra flag doesn't help because it is not passed on via apm when atom is being launched. I suspect the only real solution here is using the batch file approach - either targeting the shim or the versioned path to atom.exe. |
Having a batch file at
Result:
If I change it to target the shim, it still works (tests are run):
Result:
Removing the
Result:
This confirms that the shim is now functioning correctly, but it's still not possible to achieve the outcome we need without writing a batch file. Is it possible to additionally generate a batch file to target the shim or have the shim default to --shimgen--waitforexit? |
@joefitzgerald Thanks for digging into this. I'm fine adding custom chocolatey support to Also, it would be great to add (and blog about) an appveyor setup on https://github.com/atom/ci once it is good to go. |
@kevinsawicki yep, that might be appropriate. At first glance, this would require:
|
@joefitzgerald thanks for digging in. I'd suggest updating the chocolatey package to additionally create the |
Also, @kevinsawicki I'd be happy to make a PR against https://github.com/atom/ci and / or help you with an article on AppVeyor if you'd like. |
@kevinsawicki for your reference:
|
Adding another line like https://github.com/atom/chocolatey/blob/master/chocolatey/tools/chocolateyInstall.ps1#L27 for
atom.bat
(Install-BinFile "apm" "$dest\Atom\atom.exe"
) would fix issues described:Removing the
atom.exe
file from%ALLUSERSPROFILE%\Chocolatey\bin\atom.exe
and replacing it with%ALLUSERSPROFILE%\Chocolatey\bin\atom.bat
with the following content allows specs to run viaapm test
and allowsatom .
oratom c:\windows
to work.What's the rationale for the
.exe
shim vs a.bat
?The text was updated successfully, but these errors were encountered: