PDA

View Full Version : Create Folder Shortcut



USVPN
01-05-2010, 02:06 AM
Hi,
I want to create a Shortcut Folder in ::

%ProgramFiles%\ThirdParty

Named "XYZ" that refers to %AppFolder%\XYZ

How should I do that?
Thanks :)

jassing
01-05-2010, 11:26 AM
Hi,
I want to create a Shortcut Folder in ::

%ProgramFiles%\ThirdParty

Named "XYZ" that refers to %AppFolder%\XYZ

How should I do that?
Thanks :)

The helpfile is a wonderful resource.. don't be afraid of it.

Shell.CreateShortcut( SessionVar.Expand("%ProgramFiles%\\ThirdParty"), "XYZ", SessionVar.Expand("%AppFolder%\\XYZ");

USVPN
01-05-2010, 03:02 PM
Thanks, so my problem would be something else!
Regardless of where user select to install application, I wanna create a folder in ProgramFiles folder and copy some files there.
So I add files to my project and change the "Install to" to ::

%ProgramFiles%\Spectrasonics\Stylus RMX

But I get this error at install time:

---------------------------
Error
---------------------------
Setup can not create the following folder:

%ProgramFiles%\Spectrasonics\Stylus RMX
---------------------------
Retry Cancel
---------------------------

Why? :huh

jassing
01-05-2010, 06:49 PM
w/o seeing your code, I have no idea.
%ProgramFiles% is not a built in variable.
If you're doing this in code, you need to use \\ not \

USVPN
01-06-2010, 12:39 AM
Thank you for your help, please just let me know how to get Program Files folder, if %ProgramFiles% is not a built in variable?! :huh
I want to add a folder and its contents to Program Files folder!
Please help me...

Benjamin
01-06-2010, 05:42 AM
use _ProgramFilesFolder or action SessionVar.Expand("%ProgramFilesFolder%"), so for 64 bit system _ProgramFilesFolder64 and SessionVar.Expand("%ProgramFilesFolder64%")

jassing
01-06-2010, 06:01 AM
You would have found these variables by hitting F1 and typing "program files"

Don't be affraid to use help; IR put a lot into the help file; with lots of examples; and it covers everything.

artistscope
08-10-2010, 09:15 AM
I'd like to create a shortcut inside the program's shortcut folder but there isn't such an equivalent like...

Shell.CreateShortcut(Shell.GetFolder(SHF_STARTMENU PROGRAMS)... but how to add the program's folder reference?

And this line doesn't work...

Shell.CreateShortcut(SessionVar.Expand("%AppShortcutFolderName%")... it creates a shortcut but not inside the prgram's shortcut folder.

jassing
08-10-2010, 09:18 AM
are you looking for SetupData.GetAppShortcutFolderPath()?

Ulrich
08-10-2010, 09:41 AM
I'd like to create a shortcut inside the program's shortcut folder...
And this line doesn't work...

Shell.CreateShortcut(SessionVar.Expand("%AppShortcutFolderName%")... it creates a shortcut but not inside the prgram's shortcut folder.

You can use something like this:

Shell.CreateShortcut(SessionVar.Expand("%StartProgramsFolder%\\%AppShortcutFolderName%"), "Desciption", SessionVar.Expand("%AppFolder%\\program.exe"));
The Session Variable %AppShortcutFolderName% contains only the folder name, not a path.

Ulrich