Summary
How to create a shortcut to a file on a drive that does not exist.Synopsis
The following steps demonstrate how to create the shortcut properly and why each step is taken.Discussion
- Create an entry in the Directory table that we will reference later. For this example, MYDIR was created. Notice that INSTALLDIR is set as the parent of the new directory. This is a temporary placeholder. MYDIR?s value will be reassigned in a later step. DefaultDir can have any value that you choose. This will also be reassigned at a later time.
- Create a shortcut in the Shortcut view under System Configuration. When choosing the type of shortcut, be sure to choose Shortcut to Preexisting File. Select the shortcut to set its properties. Be sure to complete the Description property and, if you want an icon different from the file type that will be associated with the target, complete the Icon File property. The important property to this tip is to set the Target property to [MYDIR], followed by the file name which will be the target of the shortcut. For this example, the target will be an access database called test.mdb. In this case, set the Target property to ?[MYDIR]test.mdb?.
- Create a Custom Action to Set a Directory. In this step, the directory previously created will change in value to the proper location. To do this, select the Custom Actions view under Behavior and Logic. Next, create a new custom action of type New Set Directory. For the Directory Name, choose MYDIR from the drop down list. Set the Directory Value to the true location of the file, such as z:\databases\access. Leave off the trailing backslash. Windows Installer includes the backslash since the directory is surrounded by square brackets. This is just the directory path, and not the path and the file name. The file name was already specified in the shortcut property Target.
- Insert the action into the proper sequence. This is the last trick to create the shortcut. While still in the Custom Actions view, choose the Installation Execute Sequence drop down list. Above, it was stated that CostFinalize validates directory entries. Since we need to have our directory reference changed after any validation occurs, choose After CostFinalize from the list.
Was this helpful?
Related Articles
Create a Shortcut Using Installscript Based on User Input and Delete The Shortcut on Uninstalling The Installer 8Number of Views Create a Shortcut on the Quick Launch Bar 3Number of Views How to Create an Internet Shortcut with .url file and msedge.exe 22Number of Views Shortcut to Folder Created Using AddFolderIcon Opens the Open With Box 3Number of Views InstallScript MSI projects display dialog "Directory does not exist and can not be created!" 4Number of Views
Revenera Assistant
Online
Hi, I am Reva - Ask me anything.
Updates
No new updates
Chat
Home
Updates
/**/
Thanks for the feedback!
Your feedback has been saved.Rate this response:
1
2
3
4
5
Add Additional feedback ( Optional )
0/240
English
English
Language changed successfully
Something went wrong
Email sent successfully
Something went wrong
Case create successfully
Are you sure you want to cancel
the case creation?
Please select a product to submit the case.
Please select a product version to submit the case.
0/255
Upload Attachment
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to cancel the case creation?
Case closed successfully
File Upload
Maximum file size allowed is 3 MB.
File type not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
File Upload
Maximum file
size allowed is 3 MB.
File type
not supported.
Supported file types:
Documents (.txt, .doc, .docx, .pdf), Images (.jpg, .png), Comma Separated Files
(.csv) Speadsheets (.xlsx, .xls)
© 2026 Flexera Software. All Rights Reserved.
Case id: 00001065
Activity: Status change: 2 hours ago