Explorar o código

Added new [Run] and [UninstallRun] sections flag: dontlogparameters. If this flag is specified, the command line parameters for the program will not be included in the log file.

Martijn Laan %!s(int64=5) %!d(string=hai) anos
pai
achega
b613d19325
Modificáronse 7 ficheiros con 15 adicións e 7 borrados
  1. 3 0
      ISHelp/isetup.xml
  2. 3 2
      Projects/Compile.pas
  3. 2 0
      Projects/Install.pas
  4. 1 1
      Projects/Main.pas
  5. 2 2
      Projects/Struct.pas
  6. 3 2
      Projects/Undo.pas
  7. 1 0
      whatsnew.htm

+ 3 - 0
ISHelp/isetup.xml

@@ -2603,6 +2603,9 @@ Filename: "{app}\MYPROG.EXE"; Description: "Launch application"; Flags: postinst
 <p>This flag can only be used when Setup is running on 64-bit Windows, otherwise an error will occur. On an installation supporting both 32- and 64-bit architectures, it is possible to avoid the error by adding a <tt>Check: IsWin64</tt> parameter, which will cause the entry to be silently skipped when running on 32-bit Windows.</p>
 <p>This flag can only be used when Setup is running on 64-bit Windows, otherwise an error will occur. On an installation supporting both 32- and 64-bit architectures, it is possible to avoid the error by adding a <tt>Check: IsWin64</tt> parameter, which will cause the entry to be silently skipped when running on 32-bit Windows.</p>
 <p>This flag cannot be combined with the <tt>shellexec</tt> flag.</p>
 <p>This flag cannot be combined with the <tt>shellexec</tt> flag.</p>
 </flag>
 </flag>
+<flag name="dontlogparameters">
+<p>If this flag is specified, the command line parameters for the program will not be included in the log file.</p>
+</flag>
 <flag name="hidewizard">
 <flag name="hidewizard">
 <p>If this flag is specified, the wizard will be hidden while the program is running.</p>
 <p>If this flag is specified, the wizard will be hidden while the program is running.</p>
 </flag>
 </flag>

+ 3 - 2
Projects/Compile.pas

@@ -6748,12 +6748,12 @@ const
     (Name: ParamCommonAfterInstall; Flags: []),
     (Name: ParamCommonAfterInstall; Flags: []),
     (Name: ParamCommonMinVersion; Flags: []),
     (Name: ParamCommonMinVersion; Flags: []),
     (Name: ParamCommonOnlyBelowVersion; Flags: []));
     (Name: ParamCommonOnlyBelowVersion; Flags: []));
-  Flags: array[0..17] of PChar = (
+  Flags: array[0..18] of PChar = (
     'nowait', 'waituntilidle', 'shellexec', 'skipifdoesntexist',
     'nowait', 'waituntilidle', 'shellexec', 'skipifdoesntexist',
     'runminimized', 'runmaximized', 'showcheckbox', 'postinstall',
     'runminimized', 'runmaximized', 'showcheckbox', 'postinstall',
     'unchecked', 'skipifsilent', 'skipifnotsilent', 'hidewizard',
     'unchecked', 'skipifsilent', 'skipifnotsilent', 'hidewizard',
     'runhidden', 'waituntilterminated', '32bit', '64bit', 'runasoriginaluser',
     'runhidden', 'waituntilterminated', '32bit', '64bit', 'runasoriginaluser',
-    'runascurrentuser');
+    'runascurrentuser', 'dontlogparameters');
 var
 var
   Values: array[TParam] of TParamValue;
   Values: array[TParam] of TParamValue;
   NewRunEntry: PSetupRunEntry;
   NewRunEntry: PSetupRunEntry;
@@ -6833,6 +6833,7 @@ begin
                RunAsOriginalUser := True;
                RunAsOriginalUser := True;
              end;
              end;
           17: RunAsCurrentUser := True;
           17: RunAsCurrentUser := True;
+          18: Include(Options, roDontLogParameters);
         end;
         end;
 
 
       if not WaitFlagSpecified then begin
       if not WaitFlagSpecified then begin

+ 2 - 0
Projects/Install.pas

@@ -2756,6 +2756,8 @@ var
           SW_SHOWMAXIMIZED: Flags := Flags or utRun_RunMaximized;
           SW_SHOWMAXIMIZED: Flags := Flags or utRun_RunMaximized;
           SW_HIDE: Flags := Flags or utRun_RunHidden;
           SW_HIDE: Flags := Flags or utRun_RunHidden;
         end;
         end;
+        if roDontLogParameters in RunEntry.Options then
+          Flags := Flags or utRun_DontLogParameters;
         UninstLog.Add(utRun, [ExpandConst(RunEntry.Name),
         UninstLog.Add(utRun, [ExpandConst(RunEntry.Name),
           ExpandConst(RunEntry.Parameters), ExpandConst(RunEntry.WorkingDir),
           ExpandConst(RunEntry.Parameters), ExpandConst(RunEntry.WorkingDir),
           ExpandConst(RunEntry.RunOnceId), ExpandConst(RunEntry.Verb)],
           ExpandConst(RunEntry.RunOnceId), ExpandConst(RunEntry.Verb)],

+ 1 - 1
Projects/Main.pas

@@ -3936,7 +3936,7 @@ begin
     ExpandedFilename := ExpandConst(RunEntry.Name);
     ExpandedFilename := ExpandConst(RunEntry.Name);
     Log('Filename: ' + ExpandedFilename);
     Log('Filename: ' + ExpandedFilename);
     ExpandedParameters := ExpandConst(RunEntry.Parameters);
     ExpandedParameters := ExpandConst(RunEntry.Parameters);
-    if ExpandedParameters <> '' then
+    if not(roDontLogParameters in RunEntry.Options) and (ExpandedParameters <> '') then
       Log('Parameters: ' + ExpandedParameters);
       Log('Parameters: ' + ExpandedParameters);
 
 
     Wait := ewWaitUntilTerminated;
     Wait := ewWaitUntilTerminated;

+ 2 - 2
Projects/Struct.pas

@@ -2,7 +2,7 @@ unit Struct;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2019 Jordan Russell
+  Copyright (C) 1997-2020 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -336,7 +336,7 @@ type
     Wait: (rwWaitUntilTerminated, rwNoWait, rwWaitUntilIdle);
     Wait: (rwWaitUntilTerminated, rwNoWait, rwWaitUntilIdle);
     Options: set of (roShellExec, roSkipIfDoesntExist,
     Options: set of (roShellExec, roSkipIfDoesntExist,
       roPostInstall, roUnchecked, roSkipIfSilent, roSkipIfNotSilent,
       roPostInstall, roUnchecked, roSkipIfSilent, roSkipIfNotSilent,
-      roHideWizard, roRun32Bit, roRun64Bit, roRunAsOriginalUser);
+      roHideWizard, roRun32Bit, roRun64Bit, roRunAsOriginalUser, roDontLogParameters);
   end;
   end;
 
 
 const
 const

+ 3 - 2
Projects/Undo.pas

@@ -69,6 +69,7 @@ const
   utRun_RunHidden = 64;
   utRun_RunHidden = 64;
   utRun_ShellExecRespectWaitFlags = 128;
   utRun_ShellExecRespectWaitFlags = 128;
   utRun_DisableFsRedir = 256;
   utRun_DisableFsRedir = 256;
+  utRun_DontLogParameters = 512;
   utDeleteFile_ExistedBeforeInstall = 1;
   utDeleteFile_ExistedBeforeInstall = 1;
   utDeleteFile_Extra = 2;
   utDeleteFile_Extra = 2;
   utDeleteFile_IsFont = 4;
   utDeleteFile_IsFont = 4;
@@ -830,7 +831,7 @@ begin
                 function of Main.pas }
                 function of Main.pas }
               if CurRec^.ExtraData and utRun_ShellExec = 0 then begin
               if CurRec^.ExtraData and utRun_ShellExec = 0 then begin
                 Log('Running Exec filename: ' + CurRecData[0]);
                 Log('Running Exec filename: ' + CurRecData[0]);
-                if CurRecData[1] <> '' then
+                if (CurRec^.ExtraData and utRun_DontLogParameters = 0) and (CurRecData[1] <> '') then
                   Log('Running Exec parameters: ' + CurRecData[1]);
                   Log('Running Exec parameters: ' + CurRecData[1]);
                 if (CurRec^.ExtraData and utRun_SkipIfDoesntExist = 0) or
                 if (CurRec^.ExtraData and utRun_SkipIfDoesntExist = 0) or
                    NewFileExistsRedir(CurRec^.ExtraData and utRun_DisableFsRedir <> 0, CurRecData[0]) then begin
                    NewFileExistsRedir(CurRec^.ExtraData and utRun_DisableFsRedir <> 0, CurRecData[0]) then begin
@@ -849,7 +850,7 @@ begin
               end
               end
               else begin
               else begin
                 Log('Running ShellExec filename: ' + CurRecData[0]);
                 Log('Running ShellExec filename: ' + CurRecData[0]);
-                if CurRecData[1] <> '' then
+                if (CurRec^.ExtraData and utRun_DontLogParameters = 0) and (CurRecData[1] <> '') then
                   Log('Running ShellExec parameters: ' + CurRecData[1]);
                   Log('Running ShellExec parameters: ' + CurRecData[1]);
                 if (CurRec^.ExtraData and utRun_SkipIfDoesntExist = 0) or
                 if (CurRec^.ExtraData and utRun_SkipIfDoesntExist = 0) or
                    FileOrDirExists(CurRecData[0]) then begin
                    FileOrDirExists(CurRecData[0]) then begin

+ 1 - 0
whatsnew.htm

@@ -30,6 +30,7 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
 
 
 <p><a name="6.0.6"></a><span class="ver">6.0.6-dev </span><span class="date">(?)</span></p>
 <p><a name="6.0.6"></a><span class="ver">6.0.6-dev </span><span class="date">(?)</span></p>
 <ul>
 <ul>
+  <li>Added new [Run] and [UninstallRun] sections flag: <tt>dontlogparameters</tt>. If this flag is specified, the command line parameters for the program will not be included in the log file.</li>
   <li>Compiler IDE change: <a href="https://i.imgur.com/wHoJ3FG.png">Improved highlighting</a> for the [CustomMessages] and [Messages] sections.</li>
   <li>Compiler IDE change: <a href="https://i.imgur.com/wHoJ3FG.png">Improved highlighting</a> for the [CustomMessages] and [Messages] sections.</li>
   <li>Pascal Scripting change: <i>Fix:</i> Support function <tt>WizardSelectComponents</tt> now also updates component sizes and the current selection's required disk space.</li>
   <li>Pascal Scripting change: <i>Fix:</i> Support function <tt>WizardSelectComponents</tt> now also updates component sizes and the current selection's required disk space.</li>
   <li>QuickStart Pack: Now registers the Inno Setup compiler path in the Inno Script Studio options so that it will find the Inno Setup compiler automatically. Required because Inno Script Studio doesn't officially support Inno Setup 6.</li> 
   <li>QuickStart Pack: Now registers the Inno Setup compiler path in the Inno Script Studio options so that it will find the Inno Setup compiler automatically. Required because Inno Script Studio doesn't officially support Inno Setup 6.</li>