Browse Source

Added new {sysnative} constant.
Fix ready label resizing. It needs this because the caption starts out empty and is set dynamically later on.
Also some tweaks.

Martijn Laan 6 years ago
parent
commit
455529261d
4 changed files with 24 additions and 6 deletions
  1. 10 3
      ISHelp/isetup.xml
  2. 2 2
      Projects/Compile.pas
  3. 8 1
      Projects/Main.pas
  4. 4 0
      Projects/Wizard.pas

+ 10 - 3
ISHelp/isetup.xml

@@ -371,6 +371,7 @@ This " contains " embedded " quotes
 <keyword value="{src}" anchor="src" />
 <keyword value="{srcexe}" anchor="srcexe" />
 <keyword value="{sys}" anchor="sys" />
+<keyword value="{sysnative}" anchor="sysnative" />
 <keyword value="{sysuserinfoname}" anchor="sysuserinfoname" />
 <keyword value="{sysuserinfoorg}" anchor="sysuserinfoorg" />
 <keyword value="{syswow64}" anchor="syswow64" />
@@ -427,9 +428,14 @@ For example: If you used <tt>{sys}\CTL3D32.DLL</tt> on an entry and the system's
 <p>On 64-bit Windows, by default, the System32 path returned by this constant maps to the directory containing 32-bit system files, just like on 32-bit Windows. (This can be overridden by enabling <link topic="32vs64bitinstalls">64-bit install mode</link>.)</p>
 </dd>
 
+<dt><b><a name="sysnative">{sysnative}</a></b></dt>
+<dd>
+<p>On 64-bit Windows, the directory containing 64-bit system files. On 32-bit Windows, the directory containing 32-bit system files.</p>
+</dd>
+
 <dt><b><a name="syswow64">{syswow64}</a></b></dt>
 <dd>
-<p>On 64-bit Windows, the system's SysWOW64 directory, typically "C:\WINDOWS\SysWOW64". This is the actual directory in which 32-bit system files reside. On 32-bit Windows, 32-bit system files reside in "System32" or "System", not in a separate SysWOW64 directory, so this constant will resolve to the same directory as <tt>{sys}</tt> if used there.</p>
+<p>On 64-bit Windows, the system's SysWOW64 directory, typically "C:\WINDOWS\SysWOW64". This is the actual directory in which 32-bit system files reside. On 32-bit Windows, 32-bit system files do not reside in a separate SysWOW64 directory, so this constant will resolve to the same directory as <tt>{sys}</tt> if used there.</p>
 <p>Do not use this constant unless you have a specific need to obtain the name of the actual directory in which 32-bit system files reside. Gratuitously using <tt>{syswow64}</tt> in places where <tt>{sys}</tt> will suffice may cause problems. (See the documentation for the <link topic="filessection">[Files]</link> section's <tt>sharedfile</tt> flag for one example.)</p>
 </dd>
 
@@ -614,11 +620,12 @@ For example: If you used <tt>{src}\MYPROG.EXE</tt> on an entry and the user is i
 
 <heading>Auto Constants</heading>
 
-<p>Besides the "common" and "user" constants, Inno Setup also supports "auto" constants. These automatically map to their "common" form unless the installation is running in <link topic="admininstallmode">non administrative install mode</link>, in which case they map to their "user" form. It is recommended you always use these "auto" constants when possible to avoid mistakes.</p>
+<p>Besides the "common" and "user" constants, Inno Setup also supports "auto" constants. These automatically map to their "common" form unless the installation is running in <link topic="admininstallmode">non administrative install mode</link>, in which case they map to their "user" form.</p>
+<p>It is recommended you always use these "auto" constants when possible to avoid mistakes.</p>
 
 <indent>
 <table>
-<tr><td></td><td><u>Administrative</u></td><td><u>Not administrative</u></td></tr>
+<tr><td></td><td><u>Administrative</u></td><td><u>Non administrative</u></td></tr>
 <tr><td><tt><a name="autoappdata">autoappdata</a></tt></td><td><tt>commonappdata</tt></td><td><tt>userappdata</tt></td></tr>
 <tr><td><tt><a name="autocf">autocf</a></tt></td><td><tt>commoncf</tt></td><td><tt>usercf</tt></td></tr>
 <tr><td><tt><a name="autocf32">autocf32</a></tt></td><td><tt>commoncf32</tt></td><td><tt>usercf</tt></td></tr>

+ 2 - 2
Projects/Compile.pas

@@ -2887,13 +2887,13 @@ function TSetupCompiler.CheckConst(const S: String; const MinVersion: TSetupVers
 const
   UserConsts: array[0..2] of String = (
     'userpf', 'usercf', 'username');
-  Consts: array[0..41] of String = (
+  Consts: array[0..42] of String = (
     'src', 'srcexe', 'tmp', 'app', 'win', 'sys', 'sd', 'groupname', 'fonts', 'hwnd',
     'commonpf', 'commonpf32', 'commonpf64', 'commoncf', 'commoncf32', 'commoncf64',
     'autopf', 'autopf32', 'autopf64', 'autocf', 'autocf32', 'autocf64',
     'computername', 'dao', 'cmd', 'wizardhwnd', 'sysuserinfoname', 'sysuserinfoorg',
     'userinfoname', 'userinfoorg', 'userinfoserial', 'uninstallexe',
-    'language', 'syswow64', 'log', 'dotnet11', 'dotnet20', 'dotnet2032',
+    'language', 'syswow64', 'sysnative', 'log', 'dotnet11', 'dotnet20', 'dotnet2032',
     'dotnet2064', 'dotnet40', 'dotnet4032', 'dotnet4064');
   UserShellFolderConsts: array[0..8] of String = (
     'userdesktop', 'userstartmenu', 'userprograms', 'userstartup',

+ 8 - 1
Projects/Main.pas

@@ -119,7 +119,7 @@ var
   OriginalEntryIndexes: array[TEntryType] of TList;
 
   { 'Constants' }
-  SourceDir, TempInstallDir, WinDir, WinSystemDir, WinSysWow64Dir, SystemDrive,
+  SourceDir, TempInstallDir, WinDir, WinSystemDir, WinSysWow64Dir, WinSysNativeDir, SystemDrive,
     ProgramFiles32Dir, CommonFiles32Dir, ProgramFiles64Dir, CommonFiles64Dir,
     ProgramFilesUserDir, CommonFilesUserDir, CmdFilename, SysUserInfoName,
     SysUserInfoOrg, UninstallExeFilename: String;
@@ -1040,6 +1040,12 @@ begin
       Result := WinSystemDir;
     end;
   end
+  else if Cnst = 'sysnative' then begin
+    if WinSysNativeDir <> '' then
+      Result := WinSysNativeDir
+    else
+      Result := WinSystemDir;
+  end
   else if Cnst = 'src' then Result := SourceDir
   else if Cnst = 'srcexe' then Result := SetupLdrOriginalFilename
   else if Cnst = 'tmp' then Result := TempInstallDir
@@ -1314,6 +1320,7 @@ begin
   WinDir := GetWinDir;
   WinSystemDir := GetSystemDir;
   WinSysWow64Dir := GetSysWow64Dir;
+  WinSysNativeDir := GetSysNativeDir(IsWin64);
 
   { Get system drive }
   if Win32Platform = VER_PLATFORM_WIN32_NT then

+ 4 - 0
Projects/Wizard.pas

@@ -189,6 +189,7 @@ type
     DoneWithWizard: Boolean;
     PrepareToInstallNeedsRestart: Boolean;
     EnableAnchorOuterPagesOnResize: Boolean;
+    EnableAdjustReadyLabelHeightOnResize: Boolean;
     procedure AdjustFocus;
     procedure CalcCurrentComponentsSpace;
     procedure ChangeReadyLabel(const S: String);
@@ -1306,6 +1307,8 @@ begin
     AnchorOuterPage(WelcomePage, WizardBitmapImage);
     AnchorOuterPage(FinishedPage, WizardBitmapImage2);
   end;
+  if EnableAdjustReadyLabelHeightOnResize then
+    IncTopDecHeight(ReadyMemo, AdjustLabelHeight(ReadyLabel));
 end;
 
 procedure TWizardForm.FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean;
@@ -1449,6 +1452,7 @@ procedure TWizardForm.ChangeReadyLabel(const S: String);
 begin
   ReadyLabel.Caption := S;
   IncTopDecHeight(ReadyMemo, AdjustLabelHeight(ReadyLabel));
+  EnableAdjustReadyLabelHeightOnResize := True;
 end;
 
 procedure TWizardForm.ChangeFinishedLabel(const S: String);