parkerr
Posts: 10
Joined: Mon Feb 12, 2018 8:30 pm

VBScript and Bootstrapper command line properties

Hi All

I am trying to create a vbscript to check public properties that are entered as a part of /quiet install command line parameters of an exe installer.

The command line reads like this;

F:\TACSInstallation.exe /i // /l*v install.log DB_TYPE="SQL" LIC_KEY="" PRD_NAME="vcsNSWPFFeb2014" PRD_SERVER="TTG820" TRN_NAME="vcsNSWPFFeb2014" TRN_SERVER="TTG820" TST_NAME="vcsNSWPFFeb2014" TST_SERVER="TTG820"

My VBSript is setup as a Custom Action before Searches and is intended to check that the public properties all have values and to abort the install if a value is missing.

I am testing the LIC_KEY to see if a value is entered with the following script

Function WriteToLog()
dim rec
Const MsgType = &H04000000
dim UILevel, DB_TYPE, LIC_KEY,PRD_NAME, PRD_SERVER

Set rec = Installer.CreateRecord(1)

UILevel = CStr(Session.Property("UILevel"))
DB_TYPE = CStr(Session.Property("DB_TYPE"))
LIC_KEY = CStr(Session.Property("LIC_KEY"))
PRD_NAME = CStr(Session.Property("PRD_NAME"))
PRD_SERVER = CStr(Session.Property("PRD_SERVER"))

if len(LIC_KEY) = 0 then
rec.StringData(1) = "LIC_KEY is blank"
Session.Message MsgType, rec
WriteToLog = 0
System.Exception("TACSERR002 An exception has occurred. LIC_KEY must have a value")
end if
End Function

Function IIf( expr, truepart, falsepart )
IIf = falsepart
If expr Then IIf = truepart
End Function

My problem is that where the user enters LIC_KEY="" in the command line parameters LIC_KEY ends up in msi process having a value "PRD_NAME=vcsNSWPFFeb2014" without the quotes

Is there a way of getting around this with one of the following

1. exe command line delimiters
2. Another function in Advanced Installer that will allow me to verify data entered as part of the bootstrapper.
3. What is best practice for this sort of scenario for Windows Installer.

Thank you in advance for any help with this issue.

Cheers
Rob
Advanced Installer Professional version 14.5.2 build 83143
parkerr
Posts: 10
Joined: Mon Feb 12, 2018 8:30 pm

Re: VBScript and Bootstrapper command line properties

Just to clarify the command line syntax F:\TACSInstallation.exe /i is being used for testing so /quiet is being specified.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: VBScript and Bootstrapper command line properties

Hello Rob,

Thank you for bringing this to our attention. This seems to happen due to an Advanced Installer limitation when the "Enhanced User Interface" feature is not enabled (on install or always). We will try to add a fix for this issue in a future version of Advanced Installer and update this thread as soon as the fix will be available.

Until then, as a workaround, you can go to "Themes" page -> "Settings" tab and enable the "Enhanced User Interface" option and rebuild and test again the scenario.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”