This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Use Property to set Shortcut Folder Name
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 18, 2015
02:12 PM
Use Property to set Shortcut Folder Name
Working with a Basic MSI application:
I am trying to have the Programs Menu folder name set dynamically with a Property. This will alow me to have the shortcut created with an MSI command line argument. I can hardcode the folder name in the msi but thats not what im looking for. Can i have the folder name be tied back to a Property in the Property Manager? [MYDIR] for example
I am trying to have the Programs Menu folder name set dynamically with a Property. This will alow me to have the shortcut created with an MSI command line argument. I can hardcode the folder name in the msi but thats not what im looking for. Can i have the folder name be tied back to a Property in the Property Manager? [MYDIR] for example
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 20, 2015
09:40 AM
Anyone have any info?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2015
11:01 AM
So i finally figured out a way to accomplish this. With help from this link
[LIST=1]
Create your new shortcut in your component
Keep note of the "Display Name" that Installshield defaults it to
Go to your Direct Editor. Go to the Directory table
Find your "Display Name" that was generated earlier. This will be under the "Directory" column
Rename it as a Public Property(ALL UPPERCASE). In my case i named it "STARTMENUFOLDER"
Change the Directory Parent to "ProgramMenuFolder"
Change the DefaultDir to "."
Change the ISAttributes to "0" (zero)
You will need to create a Custom action (SetStartMenuFolder) that has immediate execution and in in between "FileCost" and "CostFinalize"
Also i added the last bit of code to handle uninstalling of the shortcut. Installshield wont do this for you automatically. When i install my application i create a permanent registry key that holds the value of "START_MENU_FOLDER" and i read that in the uninstaller part and manually delete the shortcut and folder if empty.
Then you will need to create a bit of Installscript code. This code will change the users selected start menu value in the installation database as well as remove the left over shortcuts and menu folder upon uninstall.
[LIST=1]
Then you will need to create a bit of Installscript code. This code will change the users selected start menu value in the installation database as well as remove the left over shortcuts and menu folder upon uninstall.
export prototype SetStartMenuFolder(HWND);
function SetStartMenuFolder(hMSI)
STRING svREMOVE, szUserInput, szFullPath, svStartMenuGroup;
INT iBufSize;
begin
MsiGetProperty(hMSI, "REMOVE", svREMOVE, iBufSize);
if( svREMOVE != "ALL" ) then
// Install Here
MsiGetProperty(hMSI, "START_MENU", szUserInput, iBufSize);
szFullPath = ProgramMenuFolder ^ szUserInput;
MsiSetProperty(hMSI, "STARTMENUFOLDER", szFullPath);
else
// Manually remove the shortcut and folder
MsiGetProperty(hMSI, "START_MENU_GROUP", svStartMenuGroup, iBufSize);
DeleteFolderIcon( ProgramMenuFolder ^ svStartMenuGroup , "Server Manager" ); // Delete the Shortcut by its name
DeleteDir( ProgramMenuFolder ^ svStartMenuGroup, ONLYDIR ); // Removes directory ONLY if it is empty
endif;
end;