Squirrel.Windows icon indicating copy to clipboard operation
Squirrel.Windows copied to clipboard

Could someone please elaborate on how machine wide installs are supposed to work?

Open provkristian opened this issue 10 years ago • 49 comments

I have referred to machine-wide-installs.md but am not making much progress yet with creating a successful machine wide installer. I'm not sure if this is a bug or a mistake on my part. Thanks.

Actual: After running setup.msi, logging out and back in with the current user on Windows 8, the application is not installed to %localappdata% . The setup.msi appears to run from UI that is briefly display (I accepted the UAC dialog).

Expected: From reading the documentation, I'm assuming that the app should be installed.

Repro steps:

  1. create nuget package (from nuget -pack command) -> output UserInterfaceApp.1.0.5855.30430.nupkg
  2. run releasify from CI powershell .\packages\squirrel.windows.1.2.1\tools\Squirrel.exe --shortcut-locations='Startup' --releasify $package.name (copied to S3 afterward)
  3. download files from S3 bucket to a local folder on the desktop (%userprofile%\desktop\test) and make sure to unblock the .exe and .msi from the properties dialog) RELEASES Setup.exe Setup.msi UserInterfaceApp-1.0.5855.30430-full.nupkg
  4. from a non-admin command prompt: cd %userprofile%\desktop\test Setup.msi

Notes: There are no errors in the eventvwr. There is no new entry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run after running setup.msi. This is a SquirrelAware app using SquirrelAwareApp.HandleEvents(); to avoid the default behavior of creating shortcuts.

provkristian avatar Jan 13 '16 17:01 provkristian

Please take a look at https://github.com/Squirrel/Squirrel.Windows/issues/508 There is a patch and a fix on similar issues. Hope it helps.

skaryshev avatar Jan 13 '16 18:01 skaryshev

@skaryshev Thanks but I believe that this is a different issue. The setup.msi runs but when the user logs out and logs in again the application is not installed. There are no errors in the event log and no registry entry either.

provkristian avatar Jan 13 '16 21:01 provkristian

There is no new entry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Check Wow6432Node. Also, do you have a SquirrelSetup.log?

anaisbetts avatar Jan 13 '16 22:01 anaisbetts

There is a HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run entry with a value of %ProgramFiles%\ Installer\UserInterfaceApp.exe --checkInstall . I noticed that the installer is placed in ProgramFiles(x86) though.

I think that there might be two bugs with the registry value. 1) there's a space in the path and 2) the msi puts the installer under C:\Program Files (x86)\Installer since it's a 32 bit app.

If I manually created a copy of the installer under %ProgramFiles%\Installer it worked. Thanks.

provkristian avatar Jan 13 '16 23:01 provkristian

Huh, interesting. Thanks for the tip, we'll look into it

anaisbetts avatar Jan 14 '16 00:01 anaisbetts

@paulcbetts Thanks! Unfortunately, for our app since we use CefSharp we need to choose x86 or x64. We chose x86 to be conservative for it working on various PCs.

Please let us know if there's anything that we can do to help. Perhaps after we get more familiar with the code we could help with pull requests.

I'm not sure if what I mentioned above for issue 1 is really an issue. Maybe the code is already handling the space. For issue 2, I'm not sure if you would want a dependency on a tool like dumpbin for determining if an app is x86 or x64 (dumpbin /headers | findstr "machine") or if there's a way to read the "PE L" type entry from the binary?? Thanks. Cheers.

provkristian avatar Jan 14 '16 15:01 provkristian

@provkristian So, whether or not your app is 64-bit, the installer itself is always 32-bit. You can install 64-bit apps with a 32-bit installer without a problem

anaisbetts avatar Jan 14 '16 19:01 anaisbetts

@paulcbetts Thanks. I agree about the installer. The issue that we're seeing is that the registry entry that the Squirrel created MSI create points to %ProgramFiles%\ Installer\UserInterfaceApp.exe --checkInstall but the file is actually copied to %ProgramFiles(x86)%\Installer . We can use Powershell to workaround it if we need to but would rather not if possible.

provkristian avatar Jan 14 '16 19:01 provkristian

@provkristian No that's definitely a bug, I'll see what I can do

anaisbetts avatar Jan 14 '16 20:01 anaisbetts

@paulcbetts Okay, thank you. By the way, is there an organization behind Squirrel or is it supported by donations or anything?

provkristian avatar Jan 14 '16 22:01 provkristian

@provkristian No donations, it's free :)

anaisbetts avatar Jan 14 '16 22:01 anaisbetts

@paulcbetts Great. Thanks again. I work for a non-profit so free is helpful.

provkristian avatar Jan 14 '16 23:01 provkristian

Good morning, I'm not sure how the triage process works for Squirrel. Is there an ETA for the fix? We're tentatively planning to use Powershell instead for fresh machine install. Thanks.

provkristian avatar Jan 18 '16 16:01 provkristian

Good morning, FYI to others struggling with machine installs. It's essentially broken for our use case (machine install an app that is launched at startup) because of this issue and another (not sure if it's logged yet) where it doesn't launch the process with the proper working directory. It seems strange that Squirrel assumes that people want an app launched after install and does not give them an option to easily disable that.

Here's a simple workaround using powershell (pseudocode, I could try to share more if I have time):

  1. Unblock (assuming you're downloading from S3 or Azure Blob storage or something) and run setup.exe (using --silent)
  2. Copy Squirrel generated files to ProgramData folder (from the app data local folder)
  3. Delete Squirrel generated files in app data local and programdata
  4. Deleting Squirrel generated registry entry in HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run (be careful here) or equivalent (if 32 bit machine)
  5. Unblock a shortcut to your app that points to the programdata subfolder and copy to Startup folder $env:ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\
  6. optionally invoke item for the shortcut

I'm sharing so it's hopefully useful to others and perhaps food for thought when fixing the Squirrel issues (maybe I could help if I have time). Note: this should allow auto-update to work fine if your config entries are properly setup. Thanks. -Kristian

provkristian avatar Jan 19 '16 16:01 provkristian

I'm encountering the same bug. As mentioned above, the registry key entry points to %ProgramFiles% when it should point to %ProgramFiles(x86)%

As a temporary fix I just added a registry file to be run that changes the registry entry value to the correct location.

DenisPitcher avatar Jan 20 '16 14:01 DenisPitcher

I am having this issue as well with the new version 1.2.4.0 is a fix coming for this? Or should we just find a work around?

fburr avatar Feb 29 '16 20:02 fburr

This doesn't repro for me at all, MSIs work on 64-bit, can someone send me an MSI that doesn't work?

anaisbetts avatar Feb 29 '16 20:02 anaisbetts

Uploading Setup.zip… The issue am having is the path in the registry key is incorrect it reads

%ProgramFiles%\ Installer\DU.exe --checkInstall (wrong directory and a space before installer)

If i change it to "C:\Program Files (x86)\Installer\DU.exe" it works great.
I am going to download MyApp and see if i can recreate the issue and send you the MSI

fburr avatar Feb 29 '16 20:02 fburr

Can you also post your nuspec file? I think you're having problems because your nuspec file is incorrect. There's supposed to be a product name in that name, not Installer

anaisbetts avatar Feb 29 '16 20:02 anaisbetts

MyApp.2.5.4.zip

fburr avatar Feb 29 '16 20:02 fburr