Jelajahi Sumber

Update remaining abort/retry/ignore dialogs.

Martijn Laan 6 tahun lalu
induk
melakukan
008dbff862
5 mengubah file dengan 67 tambahan dan 68 penghapusan
  1. 9 5
      Files/Default.isl
  2. 10 6
      Files/Languages/Dutch.isl
  3. 36 50
      Projects/Install.pas
  4. 8 4
      Projects/MsgIDs.pas
  5. 4 3
      whatsnew.htm

+ 9 - 5
Files/Default.isl

@@ -249,7 +249,10 @@ SelectDirectoryLabel=Please specify the location of the next disk.
 ; *** Installation phase messages
 SetupAborted=Setup was not completed.%n%nPlease correct the problem and run Setup again.
 EntryAbortRetryIgnore=Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation.
-ChooseAction=Choose action
+AbortRetryIgnoreChooseAction=Choose action
+AbortRetryIgnoreRetry=Try again
+AbortRetryIgnoreProceedAnyway=Proceed anyway
+AbortRetryIgnoreCancel=Cancel installation
 
 ; *** Installation status messages
 StatusClosingApplications=Closing applications...
@@ -282,13 +285,14 @@ ErrorIniEntry=Error creating INI entry in file "%1".
 ; *** File copying errors
 FileAbortRetryIgnore=Click Retry to try again, Ignore to skip this file (not recommended), or Abort to cancel installation.
 FileAbortRetryIgnore2=Click Retry to try again, Ignore to proceed anyway (not recommended), or Abort to cancel installation.
-FileAbortRetryIgnoreSkip=Skip this file
-FileAbortRetryIgnoreCancel=Cancel installation
+FileAbortRetryIgnoreSkipNotRecommended=Skip this file (not recommended)
+FileAbortRetryIgnoreProceedAnywayNotRecommended=Proceed anyway (not recommended)
 SourceIsCorrupted=The source file is corrupted
 SourceDoesntExist=The source file "%1" does not exist
-ExistingFileReadOnly=The existing file is marked as read-only.%n%nClick Retry to remove the read-only attribute and try again, Ignore to skip this file, or Abort to cancel installation.
-ExistingFileReadOnly2=The existing file is marked as read-only.
+ExistingFileReadOnly=The existing file is marked as read-only.
+ExistingFileReadOnlyAbortRetryIgnore=Click Retry to remove the read-only attribute and try again, Ignore to skip this file, or Abort to cancel installation.
 ExistingFileReadOnlyRetry=Remove the read-only attribute and try again
+ExistingFileReadOnlySkip=Skip this file
 ErrorReadingExistingDest=An error occurred while trying to read the existing file:
 FileExists=The file already exists.%n%nWould you like Setup to overwrite it?
 ExistingFileNewer=The existing file is newer than the one Setup is trying to install. It is recommended that you keep the existing file.%n%nDo you want to keep the existing file?

+ 10 - 6
Files/Languages/Dutch.isl

@@ -229,7 +229,10 @@ SelectDirectoryLabel=Geef de locatie van de volgende diskette.
 ; *** Installation phase messages
 SetupAborted=Setup is niet voltooid.%n%nCorrigeer het probleem en voer Setup opnieuw uit.
 EntryAbortRetryIgnore=Klik op Opnieuw om het opnieuw te proberen, op Negeren om toch door te gaan, of op Afbreken om de installatie af te breken.
-ChooseAction=Kies actie
+AbortRetryIgnoreChooseAction=Kies actie
+AbortRetryIgnoreRetry=Probeer opnieuw
+AbortRetryIgnoreProceedAnyway=Ga toch door
+AbortRetryIgnoreCancel=Breek installatie af
 
 ; *** Installation status messages
 StatusClosingApplications=Programma's afsluiten...
@@ -262,13 +265,14 @@ ErrorIniEntry=Fout bij het maken van een INI-instelling in bestand "%1".
 ; *** File copying errors
 FileAbortRetryIgnore=Klik op Opnieuw om het opnieuw te proberen, op Negeren om dit bestand over te slaan (niet aanbevolen), of op Afbreken om de installatie af te breken.
 FileAbortRetryIgnore2=Klik op Opnieuw om het opnieuw te proberen, op Negeren om toch door te gaan (niet aanbevolen), of op Afbreken om de installatie af te breken.
-FileAbortRetryIgnoreSkip=Sla dit bestand over
-FileAbortRetryIgnoreCancel=Breek de installatie af
+FileAbortRetryIgnoreSkipNotRecommended=Sla dit bestand over (niet aanbevolen)
+FileAbortRetryIgnoreProceedAnywayNotRecommended=Ga toch door (niet aanbevolen)
 SourceIsCorrupted=Het bronbestand is beschadigd
 SourceDoesntExist=Het bronbestand "%1" bestaat niet
-ExistingFileReadOnly=Het bestaande bestand is gemarkeerd als alleen-lezen.%n%nKlik op Opnieuw om het kenmerk alleen-lezen te verwijderen en opnieuw te proberen, op Negeren om dit bestand over te slaan, of op Afbreken om de installatie af te breken.
-ExistingFileReadOnly2=Het bestaande bestand is gemarkeerd als alleen-lezen.
-ExistingFileReadOnlyRetry=Verwijder het kenmerk alleen-lezen en probeer opnieuw
+ExistingFileReadOnly=Het bestaande bestand is gemarkeerd als alleen-lezen.
+ExistingFileReadOnlyAbortRetryIgnore=Klik op Opnieuw om het kenmerk alleen-lezen te verwijderen en opnieuw te proberen, op Negeren om dit bestand over te slaan, of op Afbreken om de installatie af te breken.
+ExistingFileReadOnlyRetry=Verwijder de alleen-lezen markering en probeer opnieuw
+ExistingFileReadOnlySkip=Sla dit bestand over
 ErrorReadingExistingDest=Er is een fout opgetreden bij het lezen van het bestaande bestand:
 FileExists=Het bestand bestaat al.%n%nWilt u dat Setup het overschrijft?
 ExistingFileNewer=Het bestaande bestand is nieuwer dan het bestand dat Setup probeert te installeren. U wordt aanbevolen het bestaande bestand te behouden.%n%nWilt u het bestaande bestand behouden?

+ 36 - 50
Projects/Install.pas

@@ -196,35 +196,14 @@ begin
   ProcessEvents;
 end;
 
-function AbortRetryIgnoreMsgBox(const Text1, Text2: String): Boolean;
-{ Returns True if Ignore was selected, False if Retry was selected, or
-  calls Abort if Abort was selected. }
-begin
-  Result := False;
-  case LoggedMsgBox(Text1 + SNewLine2 + Text2, '', mbError, MB_ABORTRETRYIGNORE, True, IDABORT) of
-    IDABORT: Abort;
-    IDRETRY: ;
-    IDIGNORE: Result := True;
-  else
-    Log('LoggedMsgBox returned an unexpected value. Assuming Abort.');
-    Abort;
-  end;
-end;
-
-function AbortRetryIgnoreTaskDialogMsgBox(const TaskDialogText1, TaskDialogText2, MsgBoxText1, MsgBoxText2: String;
+function AbortRetryIgnoreTaskDialogMsgBox(const Text1, MsgBoxText2: String;
   const RetryIgnoreAbortButtonLabels: array of String): Boolean;
 { Returns True if Ignore was selected, False if Retry was selected, or
   calls Abort if Abort was selected. }
-var
-  TaskDialogText: String;
 begin
-  if TaskDialogText2 <> '' then
-    TaskDialogText := TaskDialogText1 + SNewLine2 + TaskDialogText2
-  else
-    TaskDialogText := TaskDialogText1;
   Result := False;
-  case LoggedTaskDialogMsgBox('', SetupMessages[msgChooseAction], TaskDialogText,
-         MsgBoxText1 + SNewLine2 + MsgBoxText2, '', mbError, MB_ABORTRETRYIGNORE,
+  case LoggedTaskDialogMsgBox('', SetupMessages[msgAbortRetryIgnoreChooseAction], Text1,
+         Text1 + SNewLine2 + MsgBoxText2, '', mbError, MB_ABORTRETRYIGNORE,
          RetryIgnoreAbortButtonLabels,
          0, False, True, IDABORT) of
     IDABORT: Abort;
@@ -955,8 +934,9 @@ var
             SendNotifyMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
             Break;
           end;
-        until AbortRetryIgnoreMsgBox(AddPeriod(FmtSetupMessage1(msgErrorFunctionFailedNoCode,
-          'AddFontResource')), SetupMessages[msgEntryAbortRetryIgnore]);
+        until AbortRetryIgnoreTaskDialogMsgBox(
+                AddPeriod(FmtSetupMessage1(msgErrorFunctionFailedNoCode, 'AddFontResource')), SetupMessages[msgEntryAbortRetryIgnore],
+                [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgAbortRetryIgnoreProceedAnyway], SetupMessages[msgAbortRetryIgnoreCancel]]);
       end;
     end;
 
@@ -1336,9 +1316,8 @@ var
                (ExistingFileAttr and FILE_ATTRIBUTE_READONLY <> 0) then begin
               if not(foOverwriteReadOnly in CurFile^.Options) and
                  AbortRetryIgnoreTaskDialogMsgBox(
-                   DestFile, SetupMessages[msgExistingFileReadOnly2],
-                   DestFile, SetupMessages[msgExistingFileReadOnly],
-                   [SetupMessages[msgExistingFileReadOnlyRetry], SetupMessages[msgFileAbortRetryIgnoreSkip], SetupMessages[msgFileAbortRetryIgnoreCancel]]) then begin
+                   DestFile + SNewLine2 + SetupMessages[msgExistingFileReadOnly], SetupMessages[msgExistingFileReadOnlyAbortRetryIgnore],
+                   [SetupMessages[msgExistingFileReadOnlyRetry], SetupMessages[msgExistingFileReadOnlySkip], SetupMessages[msgAbortRetryIgnoreCancel]]) then begin
                 Log('User opted not to strip the existing file''s read-only attribute. Skipping.');
                 goto Skip;
               end;
@@ -1673,8 +1652,9 @@ var
 
       if LastOperation <> '' then
         LastOperation := LastOperation + SNewLine;
-      if not AbortRetryIgnoreMsgBox(DestFile + SNewLine2 + LastOperation + Failed,
-         SetupMessages[msgFileAbortRetryIgnore]) then begin
+      if not AbortRetryIgnoreTaskDialogMsgBox(
+               DestFile + SNewLine2 + LastOperation + Failed, SetupMessages[msgFileAbortRetryIgnore],
+               [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgFileAbortRetryIgnoreSkipNotRecommended], SetupMessages[msgAbortRetryIgnoreCancel]]) then begin
         if ProgressUpdated then
           SetProgress(PreviousProgress);
         goto Retry;
@@ -1845,9 +1825,9 @@ var
                 ExpectedBytesLeft);
             until FoundFiles or
                   (foSkipIfSourceDoesntExist in CurFile^.Options) or
-                  AbortRetryIgnoreMsgBox(SetupMessages[msgErrorReadingSource] + SNewLine +
-                    AddPeriod(FmtSetupMessage(msgSourceDoesntExist, [SourceWildcard])),
-                    SetupMessages[msgFileAbortRetryIgnore]);
+                  AbortRetryIgnoreTaskDialogMsgBox(
+                    SetupMessages[msgErrorReadingSource] + SNewLine + AddPeriod(FmtSetupMessage(msgSourceDoesntExist, [SourceWildcard])), SetupMessages[msgFileAbortRetryIgnore],
+                    [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgFileAbortRetryIgnoreSkipNotRecommended], SetupMessages[msgAbortRetryIgnoreCancel]]);
             { In case we didn't end up copying all the expected bytes, bump
               the progress bar up to the expected amount }
             Inc6464(ProgressBefore, CurFile^.ExternalSize);
@@ -2142,7 +2122,9 @@ var
                   MakeDir(False, IniDir, []);
                   Break;
                 except
-                  if AbortRetryIgnoreMsgBox(GetExceptMessage, SetupMessages[msgEntryAbortRetryIgnore]) then begin
+                  if AbortRetryIgnoreTaskDialogMsgBox(
+                       GetExceptMessage, SetupMessages[msgEntryAbortRetryIgnore],
+                       [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgAbortRetryIgnoreProceedAnyway], SetupMessages[msgAbortRetryIgnoreCancel]]) then begin
                     Skip := True;
                     Break;
                   end;
@@ -2156,8 +2138,9 @@ var
                   Log('Successfully updated the .INI file.');
                   Break;
                 end;
-               until AbortRetryIgnoreMsgBox(FmtSetupMessage1(msgErrorIniEntry, IniFilename),
-                 SetupMessages[msgEntryAbortRetryIgnore]);
+               until AbortRetryIgnoreTaskDialogMsgBox(
+                       FmtSetupMessage1(msgErrorIniEntry, IniFilename), SetupMessages[msgEntryAbortRetryIgnore],
+                       [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgAbortRetryIgnoreProceedAnyway], SetupMessages[msgAbortRetryIgnoreCancel]]);
           end else
             Log('Skipping updating the .INI file, only updating uninstall log.');
 
@@ -2435,7 +2418,9 @@ var
                 end;
               end;
             except
-              if not AbortRetryIgnoreMsgBox(GetExceptMessage, SetupMessages[msgEntryAbortRetryIgnore]) then begin
+              if not AbortRetryIgnoreTaskDialogMsgBox(
+                       GetExceptMessage, SetupMessages[msgEntryAbortRetryIgnore],
+                       [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgAbortRetryIgnoreProceedAnyway], SetupMessages[msgAbortRetryIgnoreCancel]]) then begin
                 Log('Retrying.');
                 NeedToRetry := True;
               end;
@@ -2631,11 +2616,11 @@ var
           Log('Registration successful.');
         except
           Log('Registration failed:' + SNewLine + GetExceptMessage);
-          if not NoErrorMessages and
-             not AbortRetryIgnoreMsgBox(Filename + SNewLine2 +
-             FmtSetupMessage1(msgErrorRegisterServer, GetExceptMessage),
-             SetupMessages[msgFileAbortRetryIgnore2]) then
-            NeedToRetry := True;
+          if not NoErrorMessages then
+            if not AbortRetryIgnoreTaskDialogMsgBox(
+                     Filename + SNewLine2 + FmtSetupMessage1(msgErrorRegisterServer, GetExceptMessage), SetupMessages[msgFileAbortRetryIgnore2],
+                     [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgFileAbortRetryIgnoreProceedAnywayNotRecommended], SetupMessages[msgAbortRetryIgnoreCancel]]) then
+              NeedToRetry := True;
         end;
       until not NeedToRetry;
     end;
@@ -2659,11 +2644,11 @@ var
           Log('Registration successful.');
         except
           Log('Registration failed:' + SNewLine + GetExceptMessage);
-          if not NoErrorMessages and
-             not AbortRetryIgnoreMsgBox(Filename + SNewLine2 +
-             FmtSetupMessage1(msgErrorRegisterTypeLib, GetExceptMessage),
-             SetupMessages[msgFileAbortRetryIgnore2]) then
-            NeedToRetry := True;
+          if not NoErrorMessages then
+            if not AbortRetryIgnoreTaskDialogMsgBox(
+                     Filename + SNewLine2 + FmtSetupMessage1(msgErrorRegisterTypeLib, GetExceptMessage), SetupMessages[msgFileAbortRetryIgnore2],
+                     [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgFileAbortRetryIgnoreProceedAnywayNotRecommended], SetupMessages[msgAbortRetryIgnoreCancel]]) then
+              NeedToRetry := True;
         end;
       until not NeedToRetry;
     end;
@@ -3009,8 +2994,9 @@ var
     Error := RmShutdown(RmSessionHandle, ForcedActionFlag[Forced], nil);
     while Error = ERROR_FAIL_SHUTDOWN do begin
       Log('Some applications could not be shut down.');
-      if AbortRetryIgnoreMsgBox(SetupMessages[msgErrorCloseApplications],
-         SetupMessages[msgEntryAbortRetryIgnore]) then
+      if AbortRetryIgnoreTaskDialogMsgBox(
+           SetupMessages[msgErrorCloseApplications], SetupMessages[msgEntryAbortRetryIgnore],
+           [SetupMessages[msgAbortRetryIgnoreRetry], SetupMessages[msgAbortRetryIgnoreProceedAnyway], SetupMessages[msgAbortRetryIgnoreCancel]]) then
         Break;
       Log('Retrying to shut down applications using our files.' + ForcedStrings[Forced]);
       Error := RmShutdown(RmSessionHandle, ForcedActionFlag[Forced], nil);

+ 8 - 4
Projects/MsgIDs.pas

@@ -16,6 +16,10 @@ interface
 
 type
   TSetupMessageID = (
+    msgAbortRetryIgnoreCancel,
+    msgAbortRetryIgnoreChooseAction,
+    msgAbortRetryIgnoreProceedAnyway,
+    msgAbortRetryIgnoreRetry,
     msgAboutSetupMenuItem,
     msgAboutSetupMessage,
     msgAboutSetupNote,
@@ -45,7 +49,6 @@ type
     msgCannotInstallToNetworkDrive,
     msgCannotInstallToUNCPath,
     msgChangeDiskTitle,
-    msgChooseAction,
     msgClickFinish,
     msgClickNext,
     msgCloseApplications,
@@ -96,14 +99,15 @@ type
     msgErrorTooManyFilesInDir,
     msgExistingFileNewer,
     msgExistingFileReadOnly,
-    msgExistingFileReadOnly2,
+    msgExistingFileReadOnlyAbortRetryIgnore,
     msgExistingFileReadOnlyRetry,
+    msgExistingFileReadOnlySkip,
     msgExitSetupMessage,
     msgExitSetupTitle,
     msgFileAbortRetryIgnore,
     msgFileAbortRetryIgnore2,
-    msgFileAbortRetryIgnoreSkip,
-    msgFileAbortRetryIgnoreCancel,
+    msgFileAbortRetryIgnoreSkipNotRecommended,
+    msgFileAbortRetryIgnoreProceedAnywayNotRecommended,
     msgFileExists,
     msgFileNotInDir2,
     msgFinishedHeadingLabel,

+ 4 - 3
whatsnew.htm

@@ -113,7 +113,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>Added support for 64-bit mode on Windows 10 on ARM which can be used to install ARM64 binaries. See the <i>64BitThreeArch.iss</i> example script for an example which demonstrates how to install a program built for three different architectures (x86, x64, ARM64) using a single installer.</li>
 </ul>
 <ul>
-  <li>The Abort/Retry/Ignore dialog shown if an existing file is marked as read-only now displays a task dialog if supported by the system and the existing regular message box otherwise. The task dialog is more user friendly (<a href="https://i.imgur.com/IwOfoQo.png">task dialog example</a>, <a href="https://i.imgur.com/n7wh2UC.png">message box example</a>).</li>
+  <li>The Abort/Retry/Ignore dialogs shown by Setup now display a task dialog if supported by the system and the existing regular message box otherwise. The task dialog is much more user friendly (example: <a href="https://i.imgur.com/IwOfoQo.png">task dialog</a> versus <a href="https://i.imgur.com/n7wh2UC.png">message box</a>).</li>
   <li>Added new [Setup] section directive: <tt>VersionInfoOriginalFileName</tt>, which sets the original filename version value.</li>
   <li>The <tt>Permissions</tt> parameter supported by [Files], [Dirs] and [Registry] entries now also allows you to grant permission to the Guests group, the Local Service account, the Network Service account, and to the Creator Owner.</li>
   <li>Added new special-purpose <i>HelpTextNote</i> message that can be used to specify one or more lines of text that are added to the list of parameters in the summary shown when passing /HELP on the command line. This message defaults to an empty string so make sure to provide a non-empty default for all languages from your main script if you want to use it.</li>
@@ -153,9 +153,10 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
 
 <p>Contributions via <a href="https://github.com/jrsoftware/issrc" target="_blank">GitHub</a>: Thanks to jogo-, Martin Prikryl, dscharrer, Kleuter, Gavin Lambert, Stef&aacute;n &Ouml;rvar Sigmundsson, DRON, Kevin Puetz, and Sherlock Software for their contributions.</p>
 
-<p>Some messages have been added in this version:<!-- (<a href="https://github.com/jrsoftware/issrc/commit/b0cd1a0177b818e36734026c67dc24f01ad6a0d0">View differences in Default.isl</a>).--></p>
+<p>Some messages have been added and changed in this version:<!-- (<a href="https://github.com/jrsoftware/issrc/commit/b0cd1a0177b818e36734026c67dc24f01ad6a0d0">View differences in Default.isl</a>).--></p>
 <ul>
-  <li><b>New messages:</b> ChooseAction, ExistingFileReadOnly2, ExistingFileReadOnlyRetry, FileAbortRetryIgnoreSkip, FileAbortRetryIgnoreCancel, PrivilegesRequiredOverrideInstruction, PrivilegesRequiredOverrideTaskDialogText1, PrivilegesRequiredOverrideMsgBoxText1, PrivilegesRequiredOverrideTaskDialogText2, PrivilegesRequiredOverrideMsgBoxText2, PrivilegesRequiredOverrideAllUsers, PrivilegesRequiredOverrideCurrentUser, PrivilegesRequiredOverrideRecommended, UninstallDisplayNameMark, UninstallDisplayNameMarks, UninstallDisplayNameMark32Bit, UninstallDisplayNameMark64Bit, UninstallDisplayNameMarkAllUsers, UninstallDisplayNameCurrentUser.</li>
+  <li><b>New messages:</b> AbortRetryIgnoreChooseAction, AbortRetryIgnoreRetry, AbortRetryIgnoreProceedAnyway, AbortRetryIgnoreCancel, ExistingFileReadOnlyAbortRetryIgnore, ExistingFileReadOnlyRetry, ExistingFileReadOnlySkip, FileAbortRetryIgnoreProceedAnywayNotRecommended, FileAbortRetryIgnoreSkipNotRecommended, PrivilegesRequiredOverrideInstruction, PrivilegesRequiredOverrideTaskDialogText1, PrivilegesRequiredOverrideMsgBoxText1, PrivilegesRequiredOverrideTaskDialogText2, PrivilegesRequiredOverrideMsgBoxText2, PrivilegesRequiredOverrideAllUsers, PrivilegesRequiredOverrideCurrentUser, PrivilegesRequiredOverrideRecommended, UninstallDisplayNameMark, UninstallDisplayNameMarks, UninstallDisplayNameMark32Bit, UninstallDisplayNameMark64Bit, UninstallDisplayNameMarkAllUsers, UninstallDisplayNameCurrentUser.</li>
+  <li><b>Changed message:</b> ExistingFileReadOnly.</li>
 </ul>
 
 <p>Note: Only the official English and Dutch (Netherlands) translations have been updated for these changes at this moment. See the <a href="http://www.jrsoftware.org/files/istrans/">Inno Setup Translations</a> page for more information.</p>