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

Per-machine MSI creates registry entry for per-user installer with wrong path

Open jonathanbp opened this issue 5 years ago • 3 comments

Squirrel version(s)

1.9.1

Description

I'm on a 64 bit Windows 10 but installing a 32 bit application. Running the MSI (machine-wide) installer I end up with an installer located in %ProgramFiles(x86)%\NameOfApp Installer\App.exe but the registry at HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run has the following entry: %ProgramFiles%\NameOfApp Installer\App.exe --checkInstall - %ProgramFiles% vs %ProgramFiles(x86)%.

Steps to recreate

  1. Be on a Windows 10 64 bit
  2. Use squirrel in a 32 app
  3. Build the installer
  4. Run the MSI installer
  5. Verify that the registry points to a non-existent per-user installer executable

Expected behavior

The registry path should point to the actual location of the executable.

Actual behavior

The registry path points to a non-existing executable.

jonathanbp avatar Sep 05 '19 10:09 jonathanbp

I'm not sure how many times I've mentioned this, but the current behavior is correct, because of WOW64 Registry Value Redirection. From https://docs.microsoft.com/en-us/windows/win32/winprog64/registry-redirector:

To help 32-bit applications that write REG_SZ or REG_EXPAND_SZ data containing %ProgramFiles% or %commonprogramfiles% to the registry, WOW64 intercepts these write operations and replaces them with "%ProgramFiles(x86)%" and "%commonprogramfiles(x86)%". For example, if the Program Files directory is on the C drive, then "%ProgramFiles(x86)%" expands to "C:\Program Files (x86)".

anaisbetts avatar Sep 12 '19 08:09 anaisbetts

Hmm. The result for me is that the installer is not run when the user logs in. If I manually edit the registry, replacing %ProgramFiles%\NameOfApp Installer\App.exe --checkInstall with %ProgramFiles(x86)%\NameOfApp Installer\App.exe --checkInstall and logout/login then the installer is run and all is well.

jonathanbp avatar Sep 12 '19 08:09 jonathanbp

With the current version (2.0.1), the registry value is : "C:\Program Files (x86)\[NuGet Title] Deployment\[NuGet Id]DeploymentTool.exe" --checkInstall

I think the ticket can be closed.

vernou avatar Jun 30 '21 13:06 vernou