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.

This commit is contained in:
Martijn Laan 2020-06-11 15:28:58 +02:00
parent 31e5f94c25
commit b613d19325
7 changed files with 15 additions and 7 deletions

View File

@ -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 cannot be combined with the <tt>shellexec</tt> flag.</p>
</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">
<p>If this flag is specified, the wizard will be hidden while the program is running.</p>
</flag>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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>
<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>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>