The {pf} and {cf} constants have been renamed to {commonpf} and {commoncf} (this includes {pf32} to {commonpf32}, etc.). The old names are still supported.
This commit is contained in:
parent
05378219f6
commit
0cc1cda113
@ -305,8 +305,11 @@ This " contains " embedded " quotes
|
||||
<keyword value="{\}" anchor="bs" />
|
||||
<keyword value="{%NAME}" anchor="name" />
|
||||
<keyword value="{app}" anchor="app" />
|
||||
<keyword value="{commoncf}" anchor="commoncf" />
|
||||
<keyword value="{cf}" anchor="cf" />
|
||||
<keyword value="{commoncf32}" anchor="commoncf32" />
|
||||
<keyword value="{cf32}" anchor="cf32" />
|
||||
<keyword value="{commoncf64}" anchor="commoncf64" />
|
||||
<keyword value="{cf64}" anchor="cf64" />
|
||||
<keyword value="{cm:...}" anchor="cm" />
|
||||
<keyword value="{cmd}" anchor="cmd" />
|
||||
@ -337,8 +340,11 @@ This " contains " embedded " quotes
|
||||
<keyword value="{localappdata}" anchor="localappdata" />
|
||||
<keyword value="{log}" anchor="log" />
|
||||
<keyword value="{param:...}" anchor="param" />
|
||||
<keyword value="{commonpf}" anchor="commonpf" />
|
||||
<keyword value="{pf}" anchor="pf" />
|
||||
<keyword value="{commonpf32}" anchor="commonpf32" />
|
||||
<keyword value="{pf32}" anchor="pf32" />
|
||||
<keyword value="{commonpf64}" anchor="commonpf64" />
|
||||
<keyword value="{pf64}" anchor="pf64" />
|
||||
<keyword value="{reg:...}" anchor="reg" />
|
||||
<keyword value="{sd}" anchor="sd" />
|
||||
@ -362,6 +368,7 @@ This " contains " embedded " quotes
|
||||
<keyword value="{userpf}" anchor="userpf" />
|
||||
<keyword value="{userprograms}" anchor="userprograms" />
|
||||
<keyword value="{usersendto}" anchor="usersendto" />
|
||||
<keyword value="{sendto}" anchor="usersendto" />
|
||||
<keyword value="{userstartmenu}" anchor="userstartmenu" />
|
||||
<keyword value="{userstartup}" anchor="userstartup" />
|
||||
<keyword value="{usertemplates}" anchor="usertemplates" />
|
||||
@ -417,32 +424,32 @@ For example: If you used <tt>{src}\MYPROG.EXE</tt> on an entry and the user is i
|
||||
<p>System Drive. The drive Windows is installed on, typically "C:". This directory constant is equivalent to the <i>SystemDrive</i> environment variable.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="pf">{pf}</a></b></dt>
|
||||
<dt><b><a name="commonpf">{commonpf}</a></b></dt>
|
||||
<dd>
|
||||
<p>Program Files. The path of the system's Program Files directory. <tt>{pf}</tt> is equivalent to <tt>{pf32}</tt> unless the install is running in <link topic="32vs64bitinstalls">64-bit mode</link>, in which case it is equivalent to <tt>{pf64}</tt>.</p>
|
||||
<p>Program Files. The path of the system's Program Files directory. <tt>{commonpf}</tt> is equivalent to <tt>{commonpf32}</tt> unless the install is running in <link topic="32vs64bitinstalls">64-bit mode</link>, in which case it is equivalent to <tt>{commonpf64}</tt>.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="pf32">{pf32}</a></b></dt>
|
||||
<dt><b><a name="commonpf32">{commonpf32}</a></b></dt>
|
||||
<dd>
|
||||
<p>32-bit Program Files. The path of the system's 32-bit Program Files directory, typically "C:\Program Files" on 32-bit Windows and "C:\Program Files (x86)" on 64-bit Windows.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="pf64">{pf64}</a></b></dt>
|
||||
<dt><b><a name="commonpf64">{commonpf64}</a></b></dt>
|
||||
<dd>
|
||||
<p>64-bit Windows only: 64-bit Program Files. The path of the system's 64-bit Program Files directory, typically "C:\Program Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="cf">{cf}</a></b></dt>
|
||||
<dt><b><a name="commoncf">{commoncf}</a></b></dt>
|
||||
<dd>
|
||||
<p>Common Files. The path of the system's Common Files directory. <tt>{cf}</tt> is equivalent to <tt>{cf32}</tt> unless the install is running in <link topic="32vs64bitinstalls">64-bit mode</link>, in which case it is equivalent to <tt>{cf64}</tt>.</p>
|
||||
<p>Common Files. The path of the system's Common Files directory. <tt>{commoncf}</tt> is equivalent to <tt>{commoncf32}</tt> unless the install is running in <link topic="32vs64bitinstalls">64-bit mode</link>, in which case it is equivalent to <tt>{commoncf64}</tt>.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="cf32">{cf32}</a></b></dt>
|
||||
<dt><b><a name="commoncf32">{commoncf32}</a></b></dt>
|
||||
<dd>
|
||||
<p>32-bit Common Files. The path of the system's 32-bit Common Files directory, typically "C:\Program Files\Common Files" on 32-bit Windows and "C:\Program Files (x86)\Common Files" on 64-bit Windows.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="cf64">{cf64}</a></b></dt>
|
||||
<dt><b><a name="commoncf64">{commoncf64}</a></b></dt>
|
||||
<dd>
|
||||
<p>64-bit Windows only: 64-bit Common Files. The path of the system's 64-bit Common Files directory, typically "C:\Program Files\Common Files". An exception will be raised if an attempt is made to expand this constant on 32-bit Windows.</p>
|
||||
</dd>
|
||||
@ -459,7 +466,7 @@ For example: If you used <tt>{src}\MYPROG.EXE</tt> on an entry and the user is i
|
||||
|
||||
<dt><b><a name="dao">{dao}</a></b></dt>
|
||||
<dd>
|
||||
<p>DAO directory. This is equivalent to <tt>{cf}\Microsoft Shared\DAO</tt>.</p>
|
||||
<p>DAO directory. This is equivalent to <tt>{commoncf}\Microsoft Shared\DAO</tt>.</p>
|
||||
</dd>
|
||||
|
||||
<dt><b><a name="dotnet11">{dotnet11}</a></b></dt>
|
||||
@ -585,6 +592,23 @@ For example: If you used <tt>{src}\MYPROG.EXE</tt> on an entry and the user is i
|
||||
|
||||
</dl>
|
||||
|
||||
<heading>Renamed Constants</heading>
|
||||
|
||||
<p>Inno Setup 5.7.0 renamed some of the directory and shell folder constants. The old names are still supported, but it is recommended to update your scripts to the new names.</p>
|
||||
|
||||
<indent>
|
||||
<table>
|
||||
<tr><td><u>Old name</u></td><td><u>New name</u></td></tr>
|
||||
<tr><td><tt><a name="cf">cf</a></tt></td><td><tt>commoncf</tt></td></tr>
|
||||
<tr><td><tt><a name="cf32">cf32</a></tt></td><td><tt>commoncf32</tt></td></tr>
|
||||
<tr><td><tt><a name="cf64">cf64</a></tt></td><td><tt>commoncf64</tt></td></tr>
|
||||
<tr><td><tt><a name="pf">pf</a></tt></td><td><tt>commonpf</tt></td></tr>
|
||||
<tr><td><tt><a name="pf32">pf32</a></tt></td><td><tt>commonpf32</tt></td></tr>
|
||||
<tr><td><tt><a name="pf64">pf64</a></tt></td><td><tt>commonpf64</tt></td></tr>
|
||||
<tr><td><tt><a name="sendto">sendto</a></tt></td><td><tt>usersendto</tt></td></tr>
|
||||
</table>
|
||||
</indent>
|
||||
|
||||
<heading>Other Constants</heading>
|
||||
|
||||
<dl>
|
||||
@ -1356,7 +1380,7 @@ Name: "{app}\bin"
|
||||
<param name="Permissions">
|
||||
<p>Specifies additional permissions to grant in the directory's ACL (access control list). It is not recommended that you use this parameter if you aren't familiar with ACLs or why you would need to change them, because misusing it could negatively impact system security.</p>
|
||||
<p>For this parameter to have an effect the directory must be located on a partition that supports ACLs (such as NTFS), and the current user must be able to change the permissions on the directory. In the event these conditions are not met, no error message will be displayed, and the permissions will not be set.</p>
|
||||
<p>This parameter should <i>only</i> be used on directories private to your application. Never change the ACLs on top-level directories like <tt>{sys}</tt> or <tt>{pf}</tt>, otherwise you can open up security holes on your users' systems.</p>
|
||||
<p>This parameter should <i>only</i> be used on directories private to your application. Never change the ACLs on top-level directories like <tt>{sys}</tt> or <tt>{commonpf}</tt>, otherwise you can open up security holes on your users' systems.</p>
|
||||
<p>In addition, it is recommended that you avoid using this parameter to grant write access on directories containing program files. Granting, for example, <tt>everyone-modify</tt> permission on the <tt>{app}</tt> directory will allow unprivileged users to tamper with your application's program files; this creates the potential for a privilege escalation vulnerability. (However, it is safe to change the permissions on a subdirectory of your application's directory which does not contain program files, e.g. <tt>{app}\data</tt>.)</p>
|
||||
<p>The specified permissions are set regardless of whether the directory existed prior to installation.</p>
|
||||
<p>This parameter can include one or more space separated values in the format:</p>
|
||||
@ -2866,8 +2890,8 @@ Filename: "{win}\MYPROG.INI"; Section: "InstallSettings"; Key: "InstallPath"; St
|
||||
|
||||
<ul>
|
||||
<li>The System32 path returned by the <tt>{sys}</tt> constant maps to the 32-bit System directory by default.</li>
|
||||
<li>The <tt>{pf}</tt> constant is equivalent to <tt>{pf32}</tt>.</li>
|
||||
<li>The <tt>{cf}</tt> constant is equivalent to <tt>{cf32}</tt>.</li>
|
||||
<li>The <tt>{commonpf}</tt> constant is equivalent to <tt>{commonpf32}</tt>.</li>
|
||||
<li>The <tt>{commoncf}</tt> constant is equivalent to <tt>{commoncf32}</tt>.</li>
|
||||
<li>[Registry] writes to the 32-bit view by default.</li>
|
||||
<li>The <tt>{reg:...}</tt> constant reads the 32-bit view by default.</li>
|
||||
<li>The <tt>Reg*</tt> [Code] support functions access the 32-bit view by default.</li>
|
||||
@ -2881,8 +2905,8 @@ Filename: "{win}\MYPROG.INI"; Section: "InstallSettings"; Key: "InstallPath"; St
|
||||
|
||||
<ul>
|
||||
<li>The System32 path returned by the <tt>{sys}</tt> constant maps to the 64-bit System directory by default when used in the [Dirs], [Files], [InstallDelete], [Run], [UninstallDelete], and [UninstallRun] sections. This is because Setup/Uninstall temporarily disables <extlink href="http://msdn.microsoft.com/en-us/library/aa384187.aspx">WOW64 file system redirection</extlink> when files/directories are accessed by those sections. Elsewhere, System32 and <tt>{sys}</tt> map to the 32-bit System directory, as is normal in a 32-bit process.</li>
|
||||
<li>The <tt>{pf}</tt> constant is equivalent to <tt>{pf64}</tt>.</li>
|
||||
<li>The <tt>{cf}</tt> constant is equivalent to <tt>{cf64}</tt>.</li>
|
||||
<li>The <tt>{commonpf}</tt> constant is equivalent to <tt>{commonpf64}</tt>.</li>
|
||||
<li>The <tt>{commoncf}</tt> constant is equivalent to <tt>{commoncf64}</tt>.</li>
|
||||
<li>[Registry] writes to the 64-bit view by default.</li>
|
||||
<li>The <tt>{reg:...}</tt> constant reads the 64-bit view by default.</li>
|
||||
<li>The <tt>Reg*</tt> [Code] support functions access the 64-bit view by default.</li>
|
||||
|
@ -2859,16 +2859,15 @@ function TSetupCompiler.CheckConst(const S: String; const MinVersion: TSetupVers
|
||||
|
||||
const
|
||||
Consts: array[0..38] of String = (
|
||||
'src', 'srcexe', 'tmp', 'app', 'win', 'sys', 'sd', 'groupname', 'fonts',
|
||||
'hwnd', 'pf', 'pf32', 'pf64', 'cf', 'cf32', 'cf64', 'computername', 'dao',
|
||||
'cmd', 'username', 'wizardhwnd', 'sysuserinfoname', 'sysuserinfoorg',
|
||||
'src', 'srcexe', 'tmp', 'app', 'win', 'sys', 'sd', 'groupname', 'fonts', 'hwnd',
|
||||
'commonpf', 'commonpf32', 'commonpf64', 'commoncf', 'commoncf32', 'commoncf64',
|
||||
'computername', 'dao', 'cmd', 'username', 'wizardhwnd', 'sysuserinfoname', 'sysuserinfoorg',
|
||||
'userinfoname', 'userinfoorg', 'userinfoserial', 'uninstallexe',
|
||||
'language', 'syswow64', 'log', 'dotnet11', 'dotnet20', 'dotnet2032',
|
||||
'dotnet2064', 'dotnet40', 'dotnet4032', 'dotnet4064', 'userpf', 'usercf');
|
||||
UserShellFolderConsts: array[0..9] of String = (
|
||||
UserShellFolderConsts: array[0..8] of String = (
|
||||
'userdesktop', 'userstartmenu', 'userprograms', 'userstartup',
|
||||
'userappdata', 'userdocs', 'usertemplates', 'userfavorites', 'usersendto',
|
||||
'sendto' { old name of 'usersendto' });
|
||||
'userappdata', 'userdocs', 'usertemplates', 'userfavorites', 'usersendto');
|
||||
ShellFolderConsts: array[0..9] of String = (
|
||||
'group', 'commondesktop', 'commonstartmenu', 'commonprograms', 'commonstartup',
|
||||
'commonappdata', 'commondocs', 'commontemplates', 'localappdata',
|
||||
@ -2900,6 +2899,7 @@ begin
|
||||
{ Now check the constant }
|
||||
Cnst := Copy(S, Start+1, I-(Start+1));
|
||||
if Cnst <> '' then begin
|
||||
HandleRenamedConstants(Cnst);
|
||||
if Cnst = '\' then
|
||||
goto 1;
|
||||
if Cnst[1] = '%' then begin
|
||||
|
@ -988,9 +988,8 @@ var
|
||||
ShellFolderID: TShellFolderID;
|
||||
I: Integer;
|
||||
begin
|
||||
if Cnst = 'sendto' then { old name of 'usersendto' }
|
||||
Cnst := 'usersendto';
|
||||
|
||||
HandleRenamedConstants(Cnst);
|
||||
|
||||
if IsUninstaller then
|
||||
for I := Low(NoUninstallConsts) to High(NoUninstallConsts) do
|
||||
if NoUninstallConsts[I] = Cnst then
|
||||
@ -1029,7 +1028,7 @@ begin
|
||||
else
|
||||
Result := ExpandConst('{localappdata}\Programs'); { supply default, same as Window 7 and newer }
|
||||
end
|
||||
else if Cnst = 'pf' then begin
|
||||
else if Cnst = 'commonpf' then begin
|
||||
if Is64BitInstallMode then
|
||||
Result := ProgramFiles64Dir
|
||||
else
|
||||
@ -1041,21 +1040,21 @@ begin
|
||||
else
|
||||
Result := ExpandConst('{localappdata}\Programs\Common'); { supply default, same as Window 7 and newer }
|
||||
end
|
||||
else if Cnst = 'cf' then begin
|
||||
else if Cnst = 'commoncf' then begin
|
||||
if Is64BitInstallMode then
|
||||
Result := CommonFiles64Dir
|
||||
else
|
||||
Result := CommonFiles32Dir;
|
||||
end
|
||||
else if Cnst = 'pf32' then Result := ProgramFiles32Dir
|
||||
else if Cnst = 'cf32' then Result := CommonFiles32Dir
|
||||
else if Cnst = 'pf64' then begin
|
||||
else if Cnst = 'commonpf32' then Result := ProgramFiles32Dir
|
||||
else if Cnst = 'commoncf32' then Result := CommonFiles32Dir
|
||||
else if Cnst = 'commonpf64' then begin
|
||||
if IsWin64 then
|
||||
Result := ProgramFiles64Dir
|
||||
else
|
||||
InternalError('Cannot expand "pf64" constant on this version of Windows');
|
||||
end
|
||||
else if Cnst = 'cf64' then begin
|
||||
else if Cnst = 'commoncf64' then begin
|
||||
if IsWin64 then
|
||||
Result := CommonFiles64Dir
|
||||
else
|
||||
@ -1568,14 +1567,14 @@ function GetRealShellFolder(const Common: Boolean; const ID: TShellFolderID;
|
||||
CSIDL_SENDTO, CSIDL_FONTS, CSIDL_COMMON_APPDATA, CSIDL_COMMON_DOCUMENTS,
|
||||
CSIDL_COMMON_TEMPLATES, CSIDL_COMMON_FAVORITES, CSIDL_LOCAL_APPDATA));
|
||||
var
|
||||
Z: String;
|
||||
ShellFolder: String;
|
||||
begin
|
||||
if not ShellFoldersRead[Common, ID] then begin
|
||||
{ Note: Must pass Create=True or else SHGetFolderPath fails if the
|
||||
specified CSIDL is valid but doesn't currently exist. }
|
||||
Z := GetShellFolderByCSIDL(FolderIDs[Common, ID], not ReadOnly);
|
||||
ShellFolders[Common, ID] := Z;
|
||||
if not ReadOnly or (Z <> '') then
|
||||
ShellFolder := GetShellFolderByCSIDL(FolderIDs[Common, ID], not ReadOnly);
|
||||
ShellFolders[Common, ID] := ShellFolder;
|
||||
if not ReadOnly or (ShellFolder <> '') then
|
||||
ShellFoldersRead[Common, ID] := True;
|
||||
end;
|
||||
Result := ShellFolders[Common, ID];
|
||||
|
@ -54,6 +54,7 @@ const
|
||||
function StringsToCommaString(const Strings: TStrings): String;
|
||||
procedure SetStringsFromCommaString(const Strings: TStrings; const Value: String);
|
||||
function StrToVersionNumbers(const S: String; var VerData: TSetupVersionData): Boolean;
|
||||
procedure HandleRenamedConstants(var Cnst: String);
|
||||
|
||||
implementation
|
||||
|
||||
@ -265,4 +266,22 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure HandleRenamedConstants(var Cnst: String);
|
||||
begin
|
||||
if Cnst = 'sendto' then
|
||||
Cnst := 'usersendto'
|
||||
else if Cnst = 'pf' then
|
||||
Cnst := 'commonpf'
|
||||
else if Cnst = 'pf32' then
|
||||
Cnst := 'commonpf32'
|
||||
else if Cnst = 'pf64' then
|
||||
Cnst := 'commonpf64'
|
||||
else if Cnst = 'cf' then
|
||||
Cnst := 'commoncf'
|
||||
else if Cnst = 'cf32' then
|
||||
Cnst := 'commoncf32'
|
||||
else if Cnst = 'cf64' then
|
||||
Cnst := 'commoncf64';
|
||||
end;
|
||||
|
||||
end.
|
||||
|
@ -26,11 +26,12 @@ Portions Copyright © 2000-2018 Martijn Laan. All rights reserved.<br />
|
||||
For conditions of distribution and use, see <a href="http://www.jrsoftware.org/files/is/license.txt">LICENSE.TXT</a>.
|
||||
</p>
|
||||
|
||||
<p><a name="5.6.2"></a><span class="ver">5.6.2 </span><span class="date">(?)</span></p>
|
||||
<p><a name="5.7.0"></a><span class="ver">5.7.0 </span><span class="date">(?)</span></p>
|
||||
<ul>
|
||||
<li>A number of changes have been made to the "common" and "user" constants functionality:
|
||||
<ul>
|
||||
<li><b>Change in default behavior:</b> The "common" contants (<tt>commonappdata</tt>, <tt>commondesktop</tt>, <tt>commondocs</tt>, <tt>commonfavorites</tt>, <tt>commonprograms</tt>, <tt>commonstartmenu</tt><tt>commonstartup</tt>, and <tt>commontemplates</tt>) are no longer mapper to their "user" forms if the logged-in user lacks administrative privileges, or if PrivilegesRequired is set to lowest. Instead they simply return the requested common directory.</li>
|
||||
<li>The <tt>{pf}</tt> and <tt>{cf}</tt> constants have been renamed to <tt>{commonpf}</tt> and <tt>{commoncf}</tt> (this includes <tt>{pf32}</tt> to <tt>{commonpf32}</tt>, etc.). The old names are still supported, but it is recommended to update your scripts to the new names.</tt>
|
||||
<li>Pascal Scripting change: Removed the <tt>GetShellFolder</tt> support function. As the help file already recommended, use <tt>ExpandConstant</tt> instead.</li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -51,7 +52,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
|
||||
<p><a name="5.6.1"></a><span class="ver">5.6.1 </span><span class="date">(2018-06-14)</span></p>
|
||||
<ul>
|
||||
<li>/LOG: Now logs some additional information about uninstall info saving.</li>
|
||||
<li>The <tt>{sendto}</tt> constant has been renamed to <tt>{usersendto}</tt> and now can correctly trigger a <a href="#useduserareaswarnings">used user areas warning</a>. It still returns the same directory: the path to the current user's Send To folder. (There is no common Send To folder.)</li>
|
||||
<li>The <tt>{sendto}</tt> constant has been renamed to <tt>{usersendto}</tt> and now can correctly trigger a <a href="#useduserareaswarnings">used user areas warning</a>. It still returns the same directory: the path to the current user's Send To folder. (There is no common Send To folder.) Note: in Inno Setup version 5.7.0 support for the old name was readded, but it is recommended to update your scripts to the new name.</li>
|
||||
<li>Minor fixes to the registry entries logging and improved syntax highlighting introduced by the previous version.</li>
|
||||
<li>Minor tweaks.</li>
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user