Using the Inno Setup 6.0.0 beta I get this warning:
Warning: The [Setup] section directive "PrivilegesRequired" is set to "admin" but per-user areas (HKCU,userappdata,userdesktop) are used by the script. Regardless of the version of Windows, if the installation is running in administrative install mode then you should be careful about making any per-user area changes: such changes may not achieve what you are intending. See the "UsedUserAreasWarning" topic in help file for more information.
An example of this in my code:
// Returns the path where the program was last installed
function GetPathInstalled( AppID: String ): String;
var
sPrevPath: String;
begin
sPrevPath := '';
if not RegQueryStringValue( HKLM,
'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1',
'Inno Setup: App Path', sPrevpath) then
RegQueryStringValue( HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\'+AppID+'_is1' ,
'Inno Setup: App Path', sPrevpath);
Result := sPrevPath;
end;
What would be the appropriate way to handle this now using v6?
Update
To clarify for the the comments made, I have checked my script and in the [ISPP]
section I have:
#define DataDir "{userappdata}\" + MSA
In the [icons]
section I have:
Name: "{userdesktop}\Meeting Schedule Assistant"; Filename: {app}\MeetSchedAssist.exe; Tasks: desktopicon;
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Meeting Schedule Assistant"; Filename: {app}\MeetSchedAssist.exe; MinVersion: 4,4; Tasks: quicklaunchicon;
The [registry]
section also an entry:
Root: "HKCU"; Subkey: "Software\MeetSchedAssist\Meeting Schedule Assistant"; Flags: uninsdeletekey
But it also has the HKLM / HKLM64 counterparts too.
The setup by design installs the data files into the common data folder and then the application itself copies these files to the user data folder if they are missing.
I believe the reason I elevate the installer is because we have to register assemblies:
Filename: "{dotnet40}\regasm.exe"; \
Parameters: "/u PTSTools_x86.dll"; \
WorkingDir: "{app}"; \
Flags: runhidden; \
Check: FileExists(ExpandConstant('{app}\PTSTools_x86.dll')); \
AfterInstall: DoDeleteFile(ExpandConstant('{app}\PTSTools_x86.dll'))
Filename: "{dotnet4064}\regasm.exe"; \
Parameters: "/u PTSTools_x64.dll"; \
WorkingDir: "{app}"; \
Flags: runhidden; \
Check: IsWin64 and FileExists(ExpandConstant('{app}\PTSTools_x64.dll')); \
AfterInstall: DoDeleteFile(ExpandConstant('{app}\PTSTools_x64.dll'))
Should I be making any script changes here?