cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CChong
Level 11 Flexeran
Level 11 Flexeran

Web Shortcut problem in Installshield 2009

I am using a Basic MSI configuration in my project.
I want to add a shortcut to a HTTPS website on the target local machine.
the site is
https://[MACHINENAME]/Admin/homepage.aspx
where [MACHINENAME] is the name of the server.

In other words I want to dynamically change
https://[MACHINENAME]/Admin/homepage.aspx
to
https://TomsServer/Admin/homepage.aspx or whatever the server is named.

How do I go about doing this? Thanks all.
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

There is a built-in [ComputerName] property you can use.

(Windows Installer has no built-in support for Internet shortcuts, but please see the help topic "Creating Internet Shortcuts" for one option.)
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

RobertDickau wrote:
There is a built-in [ComputerName] property you can use.

(Windows Installer has no built-in support for Internet shortcuts, but please see the help topic "Creating Internet Shortcuts" for one option.)


Hi Robert,
"Creating Internet Shortcuts" is not the solution because it is not dynamic.
A lot of applications use HTTPS web for their user interfaces as a replacement for MFC or VB. This allows the application to be usable from other computers.
Even Wise for Windows Installer has functionality to get over the problem of creating Dynamic URL shortcuts. I know because I have used Wise in previous versions of our product.
This is a real shortcoming of Installshield.
0 Kudos
RobertDickau
Flexera Alumni

A .url file is really an INI file, so perhaps using that view might help; and inside an INI file you can use the expression [ComputerName], and it will be expanded to the property value at run time.
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

Although it is a serious flaw in Installshields functionality, it can be done in Installscript. Although it is not ideal.:(

First put a default shortcut into the Support folder.
Then run this script to install it onto the desktop.

MsiGetProperty(hMSI, "SUPPORTDIR", szSupportDir, nLength);
MsiGetProperty(hMSI, "DesktopFolder", szDesktopDir, nLength);
szSupportFile = szSupportDir + "\\HomePage.url";
szDesktopFile = szDesktopDir + "\\HomePage.url";
nBufferSize = 101;
GetComputerName( szComputerName , nBufferSize );
strURL = "URL=https://";
strURL = strURL + szComputerName;
strURL = strURL + "/Company/App/Homepage/Welcome.ASPX";

nError = FileInsertLine(szSupportFile, strURL, 1, REPLACE);
nError = CopyFile(szSupportFile, szDesktopFile);
0 Kudos