浏览代码

Merge branch 'main' into newicons

Martijn Laan 4 年之前
父节点
当前提交
f31fc66d95
共有 3 个文件被更改,包括 10 次插入6 次删除
  1. 5 3
      ISHelp/isxfunc.xml
  2. 4 2
      Projects/ScriptFunc_R.pas
  3. 1 1
      whatsnew.htm

+ 5 - 3
ISHelp/isxfunc.xml

@@ -13,20 +13,22 @@
       <function>
         <name>GetCmdTail</name>
         <prototype>function GetCmdTail: String;</prototype>
-        <description><p>Returns all command line parameters passed to Setup or Uninstall as a single string, including undocumented internal parameters used by Setup.</p></description>
+        <description><p>Returns all command line parameters passed to Setup or Uninstall as a single string, including undocumented internal parameters used by Setup and Uninstall.</p></description>
         <seealso><p><link topic="isxfunc_ParamStr">ParamStr</link></p></seealso>
       </function>
       <function>
         <name>ParamCount</name>
         <prototype>function ParamCount: Integer;</prototype>
-        <description><p>Returns the number of command line parameters passed to Setup or Uninstall, excluding undocumented internal parameters used by Setup.</p></description>
+        <description><p>Returns the number of command line parameters passed to Setup or Uninstall, excluding undocumented internal parameters used by Setup and Uninstall.</p></description>
         <seealso><p><link topic="isxfunc_ParamStr">ParamStr</link><br />
 <link topic="isxfunc_GetCmdTail">GetCmdTail</link></p></seealso>
       </function>
       <function>
         <name>ParamStr</name>
         <prototype>function ParamStr(Index: Integer): String;</prototype>
-        <description><p>Returns the Index-th command line parameter passed to Setup or Uninstall, excluding undocumented internal parameters used by Setup.</p></description>
+        <description><p>Returns the Index-th command line parameter passed to Setup or Uninstall, excluding undocumented internal parameters used by Setup and Uninstall.</p>
+<p>Parameter number zero is the full file name with which Setup or Uninstall was started.</p>
+<p>If Index is invalid, ParamStr returns an empty string.</p></description>
         <seealso><p><link topic="isxfunc_ParamCount">ParamCount</link><br />
 <link topic="isxfunc_GetCmdTail">GetCmdTail</link></p></seealso>
       </function>

+ 4 - 2
Projects/ScriptFunc_R.pas

@@ -98,7 +98,7 @@ function GetUninstallProgressForm: TUninstallProgressForm;
 begin
   Result := UninstallProgressForm;
   if Result = nil then
-    InternalError('An attempt was made to access UninstallProgressForm before it has been created'); 
+    InternalError('An attempt was made to access UninstallProgressForm before it has been created');
 end;
 
 function GetMsgBoxCaption: String;
@@ -535,7 +535,9 @@ begin
   end else if Proc.Name = 'GETCMDTAIL' then begin
     Stack.SetString(PStart, GetCmdTail());
   end else if Proc.Name = 'PARAMCOUNT' then begin
-    Stack.SetInt(PStart, NewParamsForCode.Count);
+    if NewParamsForCode.Count = 0 then
+      InternalError('NewParamsForCode not set');
+    Stack.SetInt(PStart, NewParamsForCode.Count-1);
   end else if Proc.Name = 'PARAMSTR' then begin
     I := Stack.GetInt(PStart-1);
     if (I >= 0) and (I < NewParamsForCode.Count) then

+ 1 - 1
whatsnew.htm

@@ -60,7 +60,7 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
     <li>Added new <tt>IsMsiProductInstalled</tt> and <tt>StrToVersion</tt> support functions.</li>
     <li>Added new <tt>AbortedByUser</tt> property to the <tt>TDownloadWizardPage</tt> support class.</li>
     <li><i>Fix:</i> <tt>CreateDownloadPage</tt>'s progress bar now supports files larger than 2 GB.</li>
-    <li>Support functions <tt>ParamCount</tt> and <tt>ParamStr</tt> now excludes undocumented internal parameters used by Setup.</li>
+    <li>Support functions <tt>ParamCount</tt> and <tt>ParamStr</tt> now exclude undocumented internal parameters used by Setup and Uninstall.</li>
     <li>The built-in download support now allows the download of files for which the server does not specify the file size and its hash checking is no longer case sensitive.</li>
   </ul>
   </li>