a collection of technical fixes and other randon stuff

Spodworld

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Dynamically relocating shortcuts in Wise Installation Studio

I often find trying to get an all singing all dancing installer working in Wise Installation studio can be a long drag for some features.

I was attempting to create a generic installer using parameters to change the properties i needed. The application was a simple lockdown browser tool but was required by multiple customers.

For this

a) The program(s) should go in a standard location eg: c:\program file\mycompany

b) The installation location should be customer related  to allow for multiple installs eg:  c:\program file\mycompany\myproduct\mycustomer

c) Have different Shortcuts for different customers(so teach release of the installer doesnt overwrite the other

d) Have different installer IDs foreach customer (so they dont end up having to uninstall to install a new instance)

  This solved the problem of location, but i've yet to change the shortcut name dynamically.

 

For this article... c) was causing a problem as there was no obvious way that seemed to work. (There were obvious ways that didnt lol)

 

 

How to change the locations of the shortcut file......

 

1. Goto the [files] section in [Installation Expert]

2. Goto Windows\Profiles\Start Menu\Programs and create yourself a dummy shortcut folder eg: myShortCuts 

3. Create your shortcut in the [Shortcuts] section in [Installation Expert].

4. Set the Dest. Directory to the new location you created (you can tweak icon and name later)

5. In [Setup Editor] go to [Product] ->[properties] and create yourself a propery called MYCUSTOMER and give it a value of 'defaultcustomer'

6. In [MSI Script] interface, use the [Set Directory] action as follows:

  • Call it MyShortCutPlacement
  • For Directory, browse to Windows\Profiles\Start Menu\Programs\myShortCuts. the value will change to MYSHORTCUTS to be referenced by wise.
  • For the Directory Value enter   [ProgramMenuFolder]\[MYCUSTOMER]\ THis should place your shortcut under the programs section with your customer name.
  • I placed the action towards the end of the User Interface script. Anywhere else seems to product the standard unhelpful error codes from windows installer.


This deals with the shortcut once using this parameter, you can alter it however you wish in the interface. I also changed the location of the installed files to be dependant on customer name. to avoid any overwriting of files