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
- :
- Environment Variable Prefix in Shortcut
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
‎Mar 31, 2010
05:35 PM
Environment Variable Prefix in Shortcut
Hello Everyone:
I'm trying to create shortcuts from within InstallShield. Our software utilizes an environment variable for a number of tasks, and we want to have the shortcuts point to an unexpanded environment variable as the target. So, the installer sets up the custom environment variable (we'll call it %CUSTOM_VAR%), and I'd like the shortcuts in the start menu to point (for example) to:
So, I don't want InstallShield to expand the environment variable. I'd like it to look like the shortcut that's attached.
The problem I seem to be having is that when I go to System Configuration -> Shortcuts and add a new "Shortcut to a preexisting file", I can put in an entry for the target that looks like the following:
[CODE][DIRPROPERTY1][/CODE]
where DIRPROPERTY1 is equivalent to:
but when I go to install, it makes the shortcut in the start menu as:
How can I remove this prefix so that the shortcuts are added correctly?
Thank you,
~Scott
I'm trying to create shortcuts from within InstallShield. Our software utilizes an environment variable for a number of tasks, and we want to have the shortcuts point to an unexpanded environment variable as the target. So, the installer sets up the custom environment variable (we'll call it %CUSTOM_VAR%), and I'd like the shortcuts in the start menu to point (for example) to:
%CUSTOM_VAR%help\install.html
So, I don't want InstallShield to expand the environment variable. I'd like it to look like the shortcut that's attached.
The problem I seem to be having is that when I go to System Configuration -> Shortcuts and add a new "Shortcut to a preexisting file", I can put in an entry for the target that looks like the following:
[CODE][DIRPROPERTY1][/CODE]
where DIRPROPERTY1 is equivalent to:
%CUSTOM_VAR%help\index.html
but when I go to install, it makes the shortcut in the start menu as:
C:\%CUSTOM_VAR%help\index.html
How can I remove this prefix so that the shortcuts are added correctly?
Thank you,
~Scott
(15) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2010
01:52 PM
Perhaps try pointing to a Property-table property [CUSTOM_VAR] with value %CUSTOMVAR% instead of to a Directory-table property. (A directory entry needs a root, which is presumably why Windows Installer puts C:\ in front.) You'll need to create the property beforehand, and enter it directly in the Shortcut properties instead of browsing, of course.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2010
02:24 PM
Ok, thanks for that insight, Robert. What is the difference between the Directory table properties and the Property table properties? When I try to put in an absolute path, it creates a variable in what I think of as the property table. So, for example, if I enter into the target field:
It actually creates a property, called [DIRPROPERTY2], and then replaces the target line with this:
[code][DIRPROPERTY2]File2.txt[/code]
I assume there is a difference between the directory table and property table. Could you explain to me how to control which table the property is entered into?
Thank you,
~Scott
Directory1\File2.txt
It actually creates a property, called [DIRPROPERTY2], and then replaces the target line with this:
[code][DIRPROPERTY2]File2.txt[/code]
I assume there is a difference between the directory table and property table. Could you explain to me how to control which table the property is entered into?
Thank you,
~Scott
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2010
03:17 PM
Easiest is probably to create the property yourself in the Property Manager view; browsing in that target-directory view for the shortcut will (as you've seen) create a Directory-table item.
As for the difference, Directory entries are used for destinations, so they need to follow some rules (always end with a backslash, don't allow certain characters, etc.). Property-table properties are used for essentially free-form text data.
As for the difference, Directory entries are used for destinations, so they need to follow some rules (always end with a backslash, don't allow certain characters, etc.). Property-table properties are used for essentially free-form text data.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 05, 2010
01:00 PM
I also have a bunch of folders that were added, presumably because I tried to create the icons first and then import them as files a while back, that I can't remove. If I right click on the folder in the shortcuts configuration window, it won't let me remove them. Do you know how to remove these folders? I presume they are attached to a component or something, but I'm not sure how to determine which component they are attached to so that I can remove them.
Thanks,
~Scott
Thanks,
~Scott
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 05, 2010
10:23 PM
If you look in the Files and Folders view, there should be a setting to display components, which should help you piece things together.
For another option, perhaps you can open the Direct Editor view and search for components, directories, etc.
For another option, perhaps you can open the Direct Editor view and search for components, directories, etc.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2010
11:25 AM
Ah ok. Thanks, I was able to remove the shortcut folders. I'm still having troubles with the C:\ being prepended, though. I tried adding the property using the property editor, so my property looks like:
CUSTOM_VAR : %CUSTOM_VAR%
And the shortcut looks like:
TARGET: [CUSTOM_VAR]
And it complains when I enter it in manually and click out of the target field that "Field 'Target' of table 'Shortcut': An invalid shortcut target name was supplied."
It doesn't revert the Target field, though. It still looks like [ONLINE_HELP_SHORTCUT]. The install still makes it C:\%CUSTOM_VAR% however, which isn't what I want.
I appreciate your help on this.
Any other ideas?
CUSTOM_VAR : %CUSTOM_VAR%
And the shortcut looks like:
TARGET: [CUSTOM_VAR]
And it complains when I enter it in manually and click out of the target field that "Field 'Target' of table 'Shortcut': An invalid shortcut target name was supplied."
It doesn't revert the Target field, though. It still looks like [ONLINE_HELP_SHORTCUT]. The install still makes it C:\%CUSTOM_VAR% however, which isn't what I want.
I appreciate your help on this.
Any other ideas?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2010
12:32 PM
Perhaps open the Direct Editor view and make sure you don't still have a CUSTOM_VAR entry in the Directory table (that is, that it's only in the Property table)?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2010
01:44 PM
I have a CUSTOM_VAR entry only in the property table. However, there is a directory entry for CUSTOM_VAR_FOLDER, which is the folder into which the shortcut is to be placed on the start menu.
I'm also getting an error when running the installer at this point, on the destination machine. It says:
{{{ Warning 1909: Could not create shortcut Help.lnk. Verify that the destination folder exists and that you can access it. }}}
I'm also getting an error when running the installer at this point, on the destination machine. It says:
{{{ Warning 1909: Could not create shortcut Help.lnk. Verify that the destination folder exists and that you can access it. }}}
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 06, 2010
05:03 PM
Backing up a bit, does this work in a separate new project?
[LIST=1]
In the Property Manager view, create a property ENVVAR with value %TEMP%
In a component's Shortcuts editor, create a "shortcut to existing file", typing in any name you want for the target, when prompted
Change the shortcut's display name to "Env Var Test"
Change the shortcut's Target to [ENVVAR] by typing it in, not browsing
Build and run the project, after which you should have a shortcut that opens the Temp folder
[LIST=1]
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2010
04:09 PM
Ok, so it works in the test project, but not in the more complicated project I have been given to work on. It seems to always append the C:\ to the front.
~Scott
~Scott
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2010
05:41 PM
Does it work in that project if you create a new property and new shortcut?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2010
05:43 PM
No, even if I create a new property, it always seems to append C:\ to the front of the path.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2010
05:58 PM
If you create an MSI log file and search for the property name, is there a hint why it changes? If you export the shortcut's component from the project that works into the larger project, does anything change?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 15, 2010
06:10 PM
Sorry for the long delay, I didn't have a chance to respond. If I export the component from the project that works with the shortcut to the temp folder, it doesn't import the property into the property table that contains the %TEMP% environment variable. Upon building and installing, it doesn't install this newly imported shortcut.
I'm not sure how to create an MSI log file. We have a log file that we write to, which is arbitrarily placed on the C:\ drive, but it doesn't contain anything related to the stuff InstallShield does automatically (basically, it only contains text that's explicitly written to the log file via UpdateLog calls).
I'm not sure how to create an MSI log file. We have a log file that we write to, which is arbitrarily placed on the C:\ drive, but it doesn't contain anything related to the stuff InstallShield does automatically (basically, it only contains text that's explicitly written to the log file via UpdateLog calls).
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 15, 2010
06:16 PM
InstallShield has some tools that will help (creating and analyzing MSI log files) under the Tools menu; please look up "log" and "logging" in the help library index for some other options.
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)