Skip to content

Commit f14e050

Browse files
committed
Fix the PromptToUninstall to use the localized app mode, rather than the code-only constants.
1 parent f61f408 commit f14e050

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Rubberduck.Deployment/InnoSetup/Includes/English.CustomMessages.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ English.RegisterAddInCaption=Register VBE Add-in
1616
English.RegisterAddInMessage=Perform user registration of VBE addin.
1717
English.RegisterAddInDescription=VBE Add-ins are registered on a per-user basis, even if the VBE add-in was installed for all users. Therefore, this must be executed on a per-user basis.
1818
English.RegisterAddInButtonCaption=Register the Rubberduck VBE Add-in
19-
English.WillExecuteAdminInstall=Rubberduck Add-In will be available to all users.%n%nNOTE: each user individually must register the Rubberduck Add-In as%nthis is a per-user setting and cannot be deployed to all users.%n%nAfter installing, a shortcut named "Repair VBE Addin registration" under the "Rubberduck" folder will be available to all users.
19+
English.WillExecuteAdminInstall=Rubberduck Add-In will be available to all users.%n%nNOTE: each user individually must register the Rubberduck Add-In as%nthis is a per-user setting and cannot be deployed to all users.%n%nAfter installing, a shortcut named "Repair VBE Addin registration" under the%nRubberduck's program folder will be available to all users.
2020
English.WillLaunchAdminInstall=The installer will request for admin privilege to install for all users and will%nresume afterward to perform the add-in registration.
2121
English.WillInstallForCurrentUser=Rubberduck Add-In will be made available to the current user only and will not%nrequire admin privileges.
2222
English.UninstallOldVersionPrompt=There seems to be a previous version of Rubberduck, installed in %s mode, and it should be uninstalled. Proceed?

Rubberduck.Deployment/InnoSetup/Installer Build Script.iss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ const
137137
///Identifiers for installation in everyone mode to support
138138
///functions that needs to distinguish between install modes.
139139
///</remarks>
140-
EveryoneAppMode = 'Everyone';
140+
EveryoneAppMode = 'AllUsers';
141141
EveryoneAppId = '{979AFF96-DD9E-4FC2-802D-9E0C36A60D09}';
142-
PerUserAppMode = 'PerUser';
142+
PerUserAppMode = 'CurrentUser';
143143
PerUserAppId = '{DF0E0E6F-2CED-482E-831C-7E9721EB66AA}';
144144
145145
///<remarks>
@@ -706,9 +706,14 @@ end;
706706
function PromptToUninstall(AppMode: string): boolean;
707707
var
708708
ErrorCode: integer;
709+
LocalizedMode: string;
709710
begin
710711
Log('A previous version of ' + AppMode + ' was detected; prompting the user whether to uninstall');
711-
if IDYES = MsgBox(Format(ExpandConstant('{cm:UninstallOldVersionPrompt}'), [AppMode]), mbConfirmation, MB_YESNO) then
712+
if AppMode = EveryoneAppMode then
713+
LocalizedMode := ExpandConstant('{cm:Everyone}')
714+
else if AppMode = PerUserAppMode then
715+
LocalizedMode := ExpandConstant('{cm:PerUser}');
716+
if IDYES = MsgBox(Format(ExpandConstant('{cm:UninstallOldVersionPrompt}'), [LocalizedMode]), mbConfirmation, MB_YESNO) then
712717
begin
713718
ErrorCode := -1;
714719
ErrorCode := UnInstallOldVersion(GetAppId(AppMode));

0 commit comments

Comments
 (0)