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

Single system/user installer for windows #238042

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kkocdko
Copy link
Contributor

@kkocdko kkocdko commented Jan 16, 2025

Related to #122698

Inno Setup already provides PrivilegesRequiredOverridesAllowed=dialog and other useful functions to support combine system(admin)/user(non-admin) installer. However, the biggest problem is, VSCode currently uses different AppId for system and user installer.

return cb => {
const x64AppId = target === 'system' ? product.win32x64AppId : product.win32x64UserAppId;
const arm64AppId = target === 'system' ? product.win32arm64AppId : product.win32arm64UserAppId;

[Setup]
AppId={#AppId}
AppName={#NameLong}
AppVerName={#NameVersion}

So, after this change (combine system/user installer) is made, one of these two types of existing users needs to do uninstall first?

But, I still think that this change is worth it. Providing a single installer is the most popular way, like Python, provides a single installer for both system/user install modes, this can reduce user confusion, and, save some CDN costs for Microsoft. LOL.

And, there's another option, keeping the user-only installer, but turn system installer into universal one.

Tips about build installer:

npm run gulp vscode-win32-x64-inno-updater
npm run gulp vscode-win32-x64-system-setup

Root: HKA; Subkey: "Software\Classes\{#RegValueName}.dtd\shell\open"; ValueType: string; ValueName: "Icon"; ValueData: """{app}\{#ExeBasename}.exe"""; Tasks: associatewithfiles
Root: HKA; Subkey: "Software\Classes\{#RegValueName}.dtd\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#ExeBasename}.exe"" ""%1"""; Tasks: associatewithfiles

Root: HKA; Subkey: "Software\Classes\.editorconfig\OpenWithProgids"; ValueType: none; ValueName: "{#
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs more work: The "Add to Path" option not perfect yet.

@kkocdko
Copy link
Contributor Author

kkocdko commented Jan 16, 2025

I found this: https://stackoverflow.com/a/16005826/ . I'll try it.

@leg9hu
Copy link

leg9hu commented Jan 16, 2025

Core play help centre

@kkocdko kkocdko force-pushed the single-windows-installer branch from fea7957 to ff5ce8a Compare January 16, 2025 19:54
@kkocdko

This comment was marked as resolved.

@kkocdko
Copy link
Contributor Author

kkocdko commented Jan 17, 2025

[Setup]
UsePreviousPrivileges=no
AppId={code:GetAppId}

The AppId with code needs UsePreviousPrivileges=no, this cause the slient update to be visable. VSCodeSetup.exe /VERYSILENT /MERGETASKS=!runcode.

IMO, for this restriction, we needs our own system/user detection and choose logic. Or we needs to do AppId migration.

Even if this restrict in Inno Setup is not exist, how can the installer determind which of system/user should be update if both is installed?


Update: this can be solved? by command line option /ALLUSERS and /CURRENTUSER. And we needs to modify updateService.win32.ts. But, we still needs to keep user installer for a while.

@kkocdko
Copy link
Contributor Author

kkocdko commented Jan 22, 2025

@joaomoreno Hi, what's your opinion in this? Here are four choices in my view.

  • Use AppId={code:GetAppId}, add /ALLUSERS and /CURRENTUSER in updateService.win32.ts for silent update, needs to keep system/user installer for a while, about few months, so that users can update smoothly.
  • Use single AppId, choose system installer's AppId, If the installer detected a user installation, prompt to require uninstall old version manually.
  • Rewrite the whole installer, use more modern installer solution, like electron/windows-installer or WIX used by Python.
  • Do nothing. Remain what it is.

I recommand the first choice. However, the decision is yours and I am not a Microsoft employee. LOL.

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

Successfully merging this pull request may close these issues.

3 participants