Kae Travis

Create a URL Shortcut using the IniFile table

With a Windows Installer there are a couple of ways we can create a URL shortcut, but I like to create a URL shortcut using the IniFile table.  In this example, we create a file called ‘Alkane App.url’ on the desktop.  It will look similar to this:

Alkane App Shortcut

 

 

 

If you opened the file in Notepad you would see it looks similar to this (depending upon the public properties we pass at install time):

[InternetShortcut]
URL=http://127.0.0.1:80
IconFile=C:\Program Files\Internet Explorer\iexplore.exe
IconIndex=0

And this is what the IniFile table looks like that creates it:

URL Shortcut IniFile table

A few pointers;  In the FileName column we should specify a short name|long name format (remember we’re adding all these entries to the same file name so they’re all identical).  The DirProperty does NOT require the square brackets (Example, [DesktopFolder] would be incorrect).  The [IPADDRESS] and [PORT] are public properties, which we specify on the install command line.  For example:

MSIEXEC /I AlkaneApp.msi IPADDRESS=”127.0.0.1″ PORT=”80″ /QB!

And the icon for this shortcut points to the Internet Explorer executable, and uses the embedded icon with an index of 0.

Also you should ensure that the Component_ points to a component which will definitely be installed (and removed).

Create a URL Shortcut using the IniFile table
Create a URL Shortcut using the IniFile table

Leave a Reply