فهرست منبع

Renamed the IsWin64 support function to Is64BitInstallModeSupported. The old name is still supported.

Martijn Laan 6 سال پیش
والد
کامیت
b19daae413
5فایلهای تغییر یافته به همراه21 افزوده شده و 18 حذف شده
  1. 15 13
      ISHelp/isxfunc.xml
  2. 1 1
      Projects/ISPP/Help/ispp.xml
  3. 3 2
      Projects/ScriptFunc.pas
  4. 1 1
      Projects/ScriptFunc_R.pas
  5. 1 1
      whatsnew.htm

+ 15 - 13
ISHelp/isxfunc.xml

@@ -464,36 +464,38 @@ end;</pre></example>
     </subcategory>
     <subcategory>
       <function>
-        <name>IsWin64</name>
-        <prototype>function IsWin64: Boolean;</prototype>
+        <name>Is64BitInstallModeSupported</name>
+        <prototype>function Is64BitInstallModeSupported: Boolean;</prototype>
         <description><p>Returns True if the system is running a 64-bit version of Windows that provides the API support Inno Setup requires to perform 64-bit installation tasks. If False is returned, you cannot utilize any of Inno Setup's 64-bit-only features.</p>
 <p>Do not use this function to detect <link topic="32vs64bitinstalls">64-bit install mode</link>, use <link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link> instead.</p></description>
         <remarks><p>This function will always return True on an x64 edition of Windows.</p>
 <p>For this function to return True on an Itanium edition of Windows, the system must be running Windows Server 2003 SP1 or later. Older versions lack APIs that Inno Setup requires (e.g. RegDeleteKeyEx).</p></remarks>
         <example><pre>begin
-  // Check IsWin64 before using a 64-bit-only feature to
+  // Check Is64BitInstallModeSupported before using a 64-bit-only feature to
   // avoid an exception when running on 32-bit Windows.
-  if IsWin64 then
+  if Is64BitInstallModeSupported then
   begin
     MsgBox('64-bit program files reside in: ' +
       ExpandConstant('{autopf64}'), mbInformation, MB_OK);
   end;
 end;</pre></example>
         <seealso><p><link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link><br />
+<link topic="isxfunc_IsX64">IsX64</link><br />
 <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
       </function>
       <function>
         <name>Is64BitInstallMode</name>
         <prototype>function Is64BitInstallMode: Boolean;</prototype>
         <description><p>Returns True if Setup or Uninstall is running in <link topic="32vs64bitinstalls">64-bit install mode</link>, or False if it is running in <link topic="32vs64bitinstalls">32-bit install mode</link>.</p></description>
-        <remarks><p>When True is returned, it is safe to assume that <link topic="isxfunc_IsWin64">IsWin64</link> will also return True.</p></remarks>
+        <remarks><p>When True is returned, it is safe to assume that <link topic="isxfunc_Is64BitInstallModeSupported">Is64BitInstallModeSupported</link> will also return True.</p></remarks>
         <example><pre>begin
   if Is64BitInstallMode then
     MsgBox('Installing in 64-bit mode', mbInformation, MB_OK)
   else
     MsgBox('Installing in 32-bit mode', mbInformation, MB_OK);
 end;</pre></example>
-        <seealso><p><link topic="isxfunc_IsWin64">IsWin64</link><br />
+        <seealso><p><link topic="isxfunc_Is64BitInstallModeSupported">Is64BitInstallModeSupported</link><br />
+<link topic="isxfunc_IsX64">IsX64</link><br />
 <link topic="isxfunc_ProcessorArchitecture">ProcessorArchitecture</link></p></seealso>
       </function>
       <function>
@@ -504,18 +506,18 @@ end;</pre></example>
 <p><tt>TSetupProcessorArchitecture = (paUnknown, paX86, paX64, paIA64, paARM64);</tt></p></description>
         <remarks><p>A 64-bit processor architecture will never be returned on 32-bit versions of Windows. Hence, you cannot use this function to detect a 64-bit AMD CPU on a 32-bit version of Windows; you'll just get back <tt>paX86</tt> if you try.</p>
 <p><tt>paUnknown</tt> is returned if Setup/Uninstall does not recognize the processor architecture. It can be assumed that an "unknown" architecture is at least capable of executing 32-bit code, or Setup/Uninstall wouldn't be running at all.</p>
-<p>If <tt>paIA64</tt> is returned, and <tt>ia64</tt> is <i>not</i> included in the value of the <link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link> [Setup] section directive, you should not assume that Inno Setup's 64-bit-only features are available -- for example, the <tt>{autopf64}</tt> constant. Those features only work when <link topic="isxfunc_IsWin64">IsWin64</link> returns True, and as documented, it may not return True on older Itanium versions of Windows that lack certain APIs Inno Setup requires.</p>
+<p>If <tt>paIA64</tt> is returned, and <tt>ia64</tt> is <i>not</i> included in the value of the <link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link> [Setup] section directive, you should not assume that Inno Setup's 64-bit-only features are available -- for example, the <tt>{autopf64}</tt> constant. Those features only work when <link topic="isxfunc_Is64BitInstallModeSupported">Is64BitInstallModeSupported</link> returns True, and as documented, it may not return True on older Itanium versions of Windows that lack certain APIs Inno Setup requires.</p>
 <p>Therefore, instead of:</p>
 <pre>
   if ProcessorArchitecture = paIA64 then
     // perform some Itanium-specific install task that
     // involves expanding {autopf64}
 </pre>
-<p>you should additionally check that IsWin64 returns True:</p>
+<p>you should additionally check that Is64BitInstallModeSupported returns True:</p>
 <pre>
   if ProcessorArchitecture = paIA64 then
   begin
-    if IsWin64 then
+    if Is64BitInstallModeSupported then
       // perform some Itanium-specific install task that
       // involves expanding {autopf64}
     else
@@ -523,7 +525,7 @@ end;</pre></example>
       // fail silently, try something else, etc.
   end;
 </pre>
-<p>If <tt>ia64</tt> <i>is</i> included in the value of the <link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link> [Setup] section directive, then it is not necessary to check IsWin64 because Setup will do so itself at startup, and fail with an error message (<tt>MissingWOW64APIs</tt>) if it is False.</p></remarks>
+<p>If <tt>ia64</tt> <i>is</i> included in the value of the <link topic="setup_architecturesinstallin64bitmode">ArchitecturesInstallIn64BitMode</link> [Setup] section directive, then it is not necessary to check Is64BitInstallModeSupported because Setup will do so itself at startup, and fail with an error message (<tt>MissingWOW64APIs</tt>) if it is False.</p></remarks>
         <example><pre>var
   S: String;
 begin
@@ -541,7 +543,7 @@ end;</pre></example>
 <link topic="isxfunc_IsX64">IsX64</link><br />
 <link topic="isxfunc_IsIA64">IsIA64</link><br />
 <link topic="isxfunc_IsARM64">IsARM64</link><br />
-<link topic="isxfunc_IsWin64">IsWin64</link><br />
+<link topic="isxfunc_Is64BitInstallModeSupported">Is64BitInstallModeSupported</link><br />
 <link topic="isxfunc_Is64BitInstallMode">Is64BitInstallMode</link></p></seealso>
       </function>
       <function>
@@ -1563,7 +1565,7 @@ end;</pre></example>
         <name>EnableFsRedirection</name>
         <prototype>function EnableFsRedirection(const Enable: Boolean): Boolean;</prototype>
         <description><p>Controls whether built-in support functions that access files disable WOW64 file system redirection (with <link topic="64bitlimitations">some exceptions</link>). Specify True in the Enable parameter to leave redirection enabled when those functions are called; specify False to disable it. Returns the previous redirection state (True if redirection was enabled).</p>
-<p>If False is passed in the Enable parameter and the user isn't running a supported 64-bit version of Windows, an exception will be raised. To avoid the exception, call <link topic="isxfunc_IsWin64">IsWin64</link> first.</p></description>
+<p>If False is passed in the Enable parameter and the user isn't running a supported 64-bit version of Windows, an exception will be raised. To avoid the exception, call <link topic="isxfunc_Is64BitInstallModeSupported">Is64BitInstallModeSupported</link> first.</p></description>
         <remarks><p>After you've performed the operation that required changing the redirection state, be sure to restore the previous state. Always use a <tt>try..finally</tt> language construct to ensure that the previous state is restored even if an exception occurs. See below for an example.</p>
 <p>By default, file system redirection is enabled in <link topic="32vs64bitinstalls">32-bit install mode</link>, and disabled in 64-bit install mode.</p>
 <p>This function has no effect on calls to functions in external DLLs. When invoking external functions, file system redirection is always left enabled.</p>
@@ -1576,7 +1578,7 @@ begin
   // First verify that the user is running a supported 64-bit version
   // of Windows, because calling EnableFsRedirection(False) will
   // raise an exception otherwise.
-  if IsWin64 then
+  if Is64BitInstallModeSupported then
   begin
     // Turn off redirection, so that cmd.exe from the 64-bit System
     // directory is launched.

+ 1 - 1
Projects/ISPP/Help/ispp.xml

@@ -1265,7 +1265,7 @@ The list of options is provided at the end of this topic.</para>
 					<pre><line><b>int</b> IsWin64()</line></pre>
 				</section>
 				<description>
-					<para>Returns non-zero if the system is running a 64-bit version of Windows that provides the API support Inno Setup requires to perform 64-bit installation tasks, or zero otherwise.</para>
+					<para>Returns non-zero if the system is running a 64-bit version of Windows.</para>
 				</description>
 			</topic>
 			<topic id="Defined">

+ 3 - 2
Projects/ScriptFunc.pas

@@ -180,7 +180,7 @@ const
   );
 
   { Main }
-  MainTable: array [0..26] of AnsiString =
+  MainTable: array [0..27] of AnsiString =
   (
     'function WizardForm: TWizardForm;',
     'function MainForm: TMainForm;',
@@ -199,7 +199,8 @@ const
     'function SuppressibleMsgBox(const Text: String; const Typ: TMsgBoxType; const Buttons, Default: Integer): Integer;',
     'function TaskDialogMsgBox(const Instruction, TaskDialogText, MsgBoxText: String; const Typ: TMsgBoxType; const Buttons: Cardinal; const ButtonLabels: TArrayOfString; const ShieldButton: Integer; const ForceMsgBox: Boolean): Integer;',
     'function SuppressibleTaskDialogMsgBox(const Instruction, TaskDialogText, MsgBoxText: String; const Typ: TMsgBoxType; const Buttons: Cardinal; const ButtonLabels: TArrayOfString; const ShieldButton: Integer; const ForceMsgBox: Boolean;'+'const Default: Integer): Integer;',
-    'function IsWin64: Boolean;',
+    'function Is64BitInstallModeSupported: Boolean;',
+    'function IsWin64: Boolean;', { old name of Is64BitInstallModeSupported }
     'function Is64BitInstallMode: Boolean;',
     'function ProcessorArchitecture: TSetupProcessorArchitecture;',
     'function IsX86: Boolean;',

+ 1 - 1
Projects/ScriptFunc_R.pas

@@ -1047,7 +1047,7 @@ begin
     for I := 0 to N-1 do
       ButtonLabels[I] := VNGetString(PSGetArrayField(Arr, I));
     Stack.SetInt(PStart, LoggedTaskDialogMsgBox('', Stack.GetString(PStart-1), Stack.GetString(PStart-2), Stack.GetString(PStart-3), GetMsgBoxCaption, TMsgBoxType(Stack.GetInt(PStart-4)), Stack.GetInt(PStart-5), ButtonLabels, Stack.GetInt(PStart-7), Stack.GetBool(PStart-8), Suppressible, Default));
-  end else if Proc.Name = 'ISWIN64' then begin
+  end else if (Proc.Name = 'IS64BITINSTALLMODESUPPORTED') or (Proc.Name = 'ISWIN64') then begin
     Stack.SetBool(PStart, IsWin64);
   end else if Proc.Name = 'IS64BITINSTALLMODE' then begin
     Stack.SetBool(PStart, Is64BitInstallMode);

+ 1 - 1
whatsnew.htm

@@ -91,7 +91,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>[Setup] section directives <tt>ChangesAssociations</tt> and <tt>ChangesEnvironment</tt> may now be set to a boolean expression, which may contain calls to check functions.</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>
   <li>Added new <tt>SameStr</tt> and <tt>SameText</tt> support functions.</li>
-  <li>Renamed the <tt>IsAdminLoggedOn</tt> support function to <tt>IsAdmin</tt>. The old name is still supported, but it is recommended to update your scripts to the new name.</li>
+  <li>Renamed the <tt>IsAdminLoggedOn</tt> support function to <tt>IsAdmin</tt> and the <tt>IsWin64</tt> support function to <tt>Is64BitInstallModeSupported</tt>. The old names are still supported, but it is recommended to update your scripts to the new names.</li>
   <li>Removed the <tt>TAlphaBitmap</tt> support class. Its functionality is now provided directly by <tt>TBitmap</tt>.</li>
 </ul>
 </li>