Is there some updated feature for Flag "foldershortcut" in [Icons] section?

259 views
Skip to first unread message

Profi Làctic

unread,
Oct 8, 2021, 11:00:30 AM10/8/21
to innosetup
Hi,

Reading the documentation i've found that actually what i need it was foldershortcut flag, but it's not working and then i read this:

" This flag is currently ignored when running on Windows 7 (or later), as folder shortcuts do not expand properly on the Start Menu anymore. It is not known whether this is a bug in Windows 7 or a removed feature.  "

Any way to handle this in windows 10?

Thank you!!

PD: i have something like this in the code

[Files]
Source: "{#MyAppLocation}"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MyDefaultModels}"; DestDir: "{userpf}\..\..\..\AuroraVR\"; Flags: ignoreversion recursesubdirs createallsubdirs

[Tasks]
Name: "modelsicon"; Description: "Crear un acceso directo a la carpeta de los modelos"; GroupDescription: "{cm:AdditionalIcons}";

[Icons]
Name: "{autodesktop}\AuroraModels"; Filename: "{userpf}\..\..\..\AuroraVR"; Tasks: modelsicon; Flags: foldershortcut

Gavin Lambert

unread,
Oct 10, 2021, 5:55:36 PM10/10/21
to inno...@googlegroups.com
On 9/10/2021 04:00, Profi Làctic wrote:
> Reading the documentation i've found that actually what i need it was foldershortcut flag, but it's not working and then i read this:

The foldershortcut is not useful for any purpose. (It used to be a way
to trick the Start Menu into doing something specific, but is no longer
relevant.) Ignore it.

In fact it should probably just be removed from Inno entirely, now that
XP support has been dropped.

> Source: "{#MyDefaultModels}"; DestDir: "{userpf}\..\..\..\AuroraVR\";
> Flags: ignoreversion recursesubdirs createallsubdirs

I don't know what you think you're doing there, but don't ever do that.
It is never legal to try to access the parent directory of one of the
folder constants -- by definition they can all be moved to different places.

Profi Làctic

unread,
Oct 11, 2021, 2:30:50 AM10/11/21
to innosetup
Thanks for the response, just want to create a folder in "C:/Users/{currentuser}" and a shortcut to there in the desktop. But i will give it a think around. Any advice will be welcome! :D

Cheers

Jernej Simončič

unread,
Oct 11, 2021, 4:10:45 AM10/11/21
to Profi Làctic on [innosetup]

On Monday, October 11, 2021, 08:30:50, Profi Làctic wrote:


Thanks for the response, just want to create a folder in "C:/Users/{currentuser}" and a shortcut to there in the desktop.
Inno doesn't have a constant for that folder, but you can use some [Code] and call SHGetKnownFolderPath with FOLDERID_Profile as parameter to get it. Note that this will only work properly if your setup is set to PrivilegesRequired=lowest.


-- 
< Jernej Simončič ><><><><>< https://eternallybored.org/ >


When you arrive at your chosen campsite, it is full.
       -- Barber's Ninth Law of Backpacking

Gavin Lambert

unread,
Oct 11, 2021, 6:01:52 PM10/11/21
to inno...@googlegroups.com
On 11/10/2021 19:30, Profi Làctic wrote:
> Thanks for the response, just want to create a folder in
> "C:/Users/{currentuser}" and a shortcut to there in the desktop. But i
> will give it a think around. Any advice will be welcome! :D

It is not recommended to put folders directly in the user profile dir.

You can use {%USERPROFILE} or look it up "manually" as Jernej stated.
But it is preferred to put files into {userappdata} instead.

Though (as Jernej also stated) you should not touch any user* folders at
all in the installer unless it is set to PrivilegesRequired=lowest
(which has other consequences). For admin installs, you should install
everything to {app}, and then on starting your app you use the files in
{userappdata} if they exist, or copy the templates from {app} to
{userappdata} otherwise.
Reply all
Reply to author
Forward
0 new messages