PDA

View Full Version : How to hide Installation UI dialogs with automation interface?



armomu
06-15-2015, 03:28 AM
For example,
I want to hide "CustomerInformation" dialog during installation executing.
I know I can modify it in the GUI.
But I need to do it with automation interface (VBScript).
How can I do it?
Is there any example?
I can just find few in the help lib, but nothing about dialog customizing.

Christopher Painter
06-15-2015, 08:39 PM
The way I would do it would be to write mututally exclusive ControlEvents with conditions such as DisplayCustomerInformation and NotDisplayCustomerInformation. Then in your build automation (either passing properties to IsCmdBld or the MSBuild targets or by modifying the ISM with the automation interface) I would seed the property DisplayCustomerInformation = 1 into the installer when you want it displayed.

It's also possible to do this by having a merge module that contains this property and using product configuration flags to control it's inclusion into the installer.

Evan Border
06-15-2015, 11:24 PM
For example,
I want to hide "CustomerInformation" dialog during installation executing.
I know I can modify it in the GUI.
But I need to do it with automation interface (VBScript).
How can I do it?
Is there any example?
I can just find few in the help lib, but nothing about dialog customizing.

If you want to use automation to automatically get rid of the CustomerInformation dialog (which involves a pair of changes in the ControlEvent table), you can use something such as the following vbscript:


Option Explicit

Dim objMsi
Dim objRecord
Dim objWI
Dim objView
Dim strPathToIsmFile

strPathToIsmFile = Wscript.Arguments(0)


Set objWI = CreateObject("WindowsInstaller.Installer")
Set objMsi = objWI.OpenDatabase(strPathToIsmFile, 2)

Set objView = objMsi.OpenView("SELECT * FROM `ControlEvent` WHERE (`Dialog_` ='LicenseAgreement') AND (`Control_`='Next') AND (`Event`='NewDialog')")
objView.Execute
Set objRecord = objView.Fetch
objRecord.StringData(4) = "SetupType"
objView.Modify 4, objRecord
Set objRecord = Nothing
Set objView = Nothing

Set objView = objMsi.OpenView("SELECT * FROM `ControlEvent` WHERE (`Dialog_` ='SetupType') AND (`Control_`='Back') AND (`Event`='NewDialog')")
objView.Execute
Set objRecord = objView.Fetch
objRecord.StringData(4) = "LicenseAgreement"
objView.Modify 4, objRecord
Set objRecord = Nothing
Set objView = Nothing

objMsi.Commit


The vbscript takes 1 parameter, the path to your ISM file. Note: in order for this to work, your ISM must be in the binary format, not the XML format.
The command line needs to be formatted as follows:
C:\Windows\System32\cscript.exe "C:\InstallShield 2015 Projects\Automation\Get_Rid_of_CustomerInformationDialog.vbs" "C:\InstallShield 2015 Projects\My Project Name-1.ism"

armomu
07-10-2015, 08:39 AM
thank u very much.

i see the windows installer automation interface is powerful.:D

now i typed some other vbs using windows installer automation interface and they are working well



If you want to use automation to automatically get rid of the CustomerInformation dialog (which involves a pair of changes in the ControlEvent table), you can use something such as the following vbscript:


Option Explicit

Dim objMsi
Dim objRecord
Dim objWI
Dim objView
Dim strPathToIsmFile

strPathToIsmFile = Wscript.Arguments(0)


Set objWI = CreateObject("WindowsInstaller.Installer")
Set objMsi = objWI.OpenDatabase(strPathToIsmFile, 2)

Set objView = objMsi.OpenView("SELECT * FROM `ControlEvent` WHERE (`Dialog_` ='LicenseAgreement') AND (`Control_`='Next') AND (`Event`='NewDialog')")
objView.Execute
Set objRecord = objView.Fetch
objRecord.StringData(4) = "SetupType"
objView.Modify 4, objRecord
Set objRecord = Nothing
Set objView = Nothing

Set objView = objMsi.OpenView("SELECT * FROM `ControlEvent` WHERE (`Dialog_` ='SetupType') AND (`Control_`='Back') AND (`Event`='NewDialog')")
objView.Execute
Set objRecord = objView.Fetch
objRecord.StringData(4) = "LicenseAgreement"
objView.Modify 4, objRecord
Set objRecord = Nothing
Set objView = Nothing

objMsi.Commit


The vbscript takes 1 parameter, the path to your ISM file. Note: in order for this to work, your ISM must be in the binary format, not the XML format.
The command line needs to be formatted as follows:
C:\Windows\System32\cscript.exe "C:\InstallShield 2015 Projects\Automation\Get_Rid_of_CustomerInformationDialog.vbs" "C:\InstallShield 2015 Projects\My Project Name-1.ism"