Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup 5.6.0 warning about shortcuts and admin v user

I upgraded Inno Setup to 5.6.0 and now when I compile I get 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 administrative then you should be careful about making any per-user area changes: such changes may not achieve what you are intending. See the help file for more information.

I understand what it is saying. 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; 

I think "back in the day" these were created by a script wizard. Now it is true that my installer is running with PrivilegesRequired. And all of the data files get installed to ProgramData folder. When the program starts it looks for any missing files and gets them from this common location.

So, the only issues pertain to these two shortcuts. What is the right way to cater for shortcuts? Since under normal circumstances the installer will add the shortcuts.

like image 532
Andrew Truckle Avatar asked Jun 13 '18 08:06

Andrew Truckle


1 Answers

Add the shortcuts for all users, not only for the user (admin) that is installing the application.

  • Use {commondesktop} instead of {userdesktop}.

  • Use {commonappdata} instead of {userappdata}.
    (though "Quick launch" toolbar is an obsolete feature)


For an alternative approach, see Inno Setup Create individual shortcuts on all desktops of all users.


Many installations have "for me"/"for all" options. In the first case, you do not need Administrator privileges and you can use the user* constants. In the later case, you need Administrator privileges and you should use common* constants. See also Make Inno Setup installer request privileges elevation only when needed.

Inno Setup 6 has a built-in support for non-administrative install mode. You can then use "Auto" constants, like {autodesktop} and {autoappdata}.

like image 169
Martin Prikryl Avatar answered Sep 18 '22 01:09

Martin Prikryl