Search code examples
vb.netinstallshieldfile-copying

InstallShield Copy file from parameters


I am struggling with InstallShield LE to create a simple installation file allowing to pass 3 specific files in parameters. After reviewing the InstallShield forum (not very active) and stackoverflow questions, I would appreciate if anyone could share his/her experience.

1st Obstacle: Understand how to pass the files in parameters?

MyAddin.exe /v"CONFIGFILE=C:\temp\Config.xml TEMPLATE1=C:\Templates\Template1.html TEMPLATE2=C:\Templates\Template2.html" /v"/qb"

a. The installation seems to execute well but I am not sure if the parameters are correctly injected. Could anyone confirm? b. Is there a way to have parameters value including spaces (e.g. C:\Program Files (x86))?


2n Obstacle: How do I copy the file into the destination folder For all 3 parameters, the script should simply check if filled => copy file to Template or Config folder located into the installation folder. To do so I believe that the only option is to define a custom action:

So I created a simple VB script based on this example which should work according to this:

' Get the value of INSTALLDIR
Dim sInstalldir
Dim configFile
Dim Template1
sInstalldir = Session.Property("INSTALLDIR")
configFile = Session.Property("CONFIGFILE")
TEMPLATE1 = Session.Property("TEMPLATE1")

 ' Show it.
 MsgBox configFile
 MsgBox sInstalldir
 MsgBox TEMPLATE2

 ' @To to be completed
  If configFile != "" Then
     '.. copy to sInstalldir & "Config"
  If TEMPLATE1 != "" Then
     '... copy to sInstalldir & "Templates"

The script executed but all popups are blank :-/ (it seems that I am not the only one) EDIT: Ok according to this the value will be null depending at which stage the custom action is executed. If executed "After initialization" which not optimal then the sInstalldir value is available. The parameters are still empty.

I saw that the installscript language provide file copy functions like in the example here but I am not sure how to create one of those script with the LE edition.

I am about to abandon and switch to NSIS or Inno setup as I am struggling to find the answer. It will be a shame to me as my install file works perfectly.


Solution

  • Ok, here is the executive summary of my findings: InstallShield Limited Edition is really ... limited. In addition to not offer the ability to check for basic prerequisite such as "Office 2013" or "Office 2016" or recent Windows versions, parameters injection do not work at all. I have install the Express version, recreate my install script and used the same VB script and the same command line and everything works like a charm. My only problem is that I only have 21 days or need to pay for the license. I really think that the InstallShield LE is confusing and not good the image of Flexerasoftware... Anyway, I hope this post will save someone's time.