1

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?

Community
  • 1
  • 1
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • 1
    I believe that the warning is not referring to the code you have posted. Inno Setup 6 does not check Pascal Script Code for uses of user-specific files/registry. --- The warning is referring to some entry of basic Inno Setup sections. – Martin Prikryl Feb 25 '19 at 13:17
  • @MartinPrikryl Thanks for the clarification. I have updated my question. – Andrew Truckle Feb 25 '19 at 14:19
  • 1
    OK. Anyway I believe you actually know what the warning means. So I'm not sure I understand what you ask for. Nothing has changed in Inno Setup 6. It's just the warning that is new. I was never correct to access HKCU from an elevated installer. See [Installing application for currently logged in user from Inno Setup installer running as Administrator](https://stackoverflow.com/q/44575666/850848). – Martin Prikryl Feb 25 '19 at 16:06

0 Answers0