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

Per-machine installer downgrades application upgraded by silent install. #523

Closed
skaryshev opened this issue Dec 14, 2015 · 8 comments
Closed

Comments

@skaryshev
Copy link
Contributor

Found in 1.2.2. Steps to reproduce:

  1. Install application version 1 by per-machine installer
  2. Build new release version 2
  3. Run application to let silent install upgrade to version 2
  4. Logout. Login. Find application downgraded to version 1 (by per-machine installer I guess)
@davidpsaylor
Copy link

I've had the same issue. Is there a suggested workaround?

@anaisbetts
Copy link
Contributor

Hm, I'm not seeing this. Does this happen with the MSI file?

@skaryshev
Copy link
Contributor Author

I releasify version 1 of App. Install MSI and re-login. Now App v1 is installed by per-machine install.
I releasify version 2 of App and run App. Now App v2 is installed by silent install.
I re-login and and the per-machine installer runs and installs App v1 again.

@anaisbetts
Copy link
Contributor

Hm, I just did exactly that with Slack and it worked. Did you change your NuGet Package ID in an update or something crazy?

@skaryshev
Copy link
Contributor Author

I am looking through the code and MachineInstaller::ShouldSilentInstall should take care of my case and prevent install if C:\Users\Username\AppData\Local$pkgName\packages dir exists. Will rebuild and try again and rebuild debug and try again....

@skaryshev
Copy link
Contributor Author

I think I found something:
src/Setup/MachineInstaller.cpp in bool MachineInstaller::ShouldSilentInstall() on line 140
installFolder is like C:\Users\Username\AppData\Local\$pkgName\packages
Note double backslash before pkgName. Because
CString pkgName = CString(ourFile + fullPath.ReverseFind(L'\\'));
returns a leading backslash and
wcscat(installFolder, L"\\"); on line 135 adds another backslash.
Anyway MachineInstaller::ShouldSilentInstall() does not work for me as expected and returns true when we're already installed.

@skaryshev
Copy link
Contributor Author

Found it! My problem was a dot in my package ID. I soon as I changed Package.Name to Package_Name the issue was resolved even with double backslash still in the path.
Thank you.

@SlySven
Copy link

SlySven commented May 23, 2024

Found it! My problem was a dot in my package ID. I soon as I changed Package.Name to Package_Name the issue was resolved even with double backslash still in the path. Thank you.

Hang on - this is exactly the opposite of what the nuget documentation says: https://learn.microsoft.com/en-us/nuget/create-packages/creating-a-package#choose-a-unique-package-identifier-and-setting-the-version-number where it says to use '.' rather than '-' or '_' to separate components!

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