我正在编写一个自定义脚本来与我的安装程序一起使用,以便用户可以根据需要选择安装工具栏。这是布局的样子:
http://i47.tinypic.com/2v92csl.png
以及随附的代码:
' Set Executable
Set WshShell = CreateObject("WScript.Shell")
' Set booleans for what features to enabled/disable
Dim Feature1 As Boolean
Dim Feature2 As Boolean
Dim Feature3 As Boolean
Dim Feature4 As Boolean
Feature1 = False
Feature2 = False
Feature3 = False
Feature4 = False
If Session.Property("RADIO") = "RadioFeatureA" Then
Feature1 = True
Feature2 = False
ElseIf Session.Property("RADIO") = "RadioFeatureB" Then
Feature2 = True
Feature1 = False
End If
' Set the checkbox1 feature if ticked
If Session.Property("CHECK1") = "install" Then
Feature3 = True
Else
Feature3 = False
End If
' Set the checkbox2 feature if ticked
If Session.Property("CHECK2") = "install" Then
Feature4 = True
Else
Feature4 = False
End If
' Execute the file
If Feature1 = True Then
WshShell.Run (""APPDIR\file.exe"" /SILENT /INSTALL)
ElseIf Feature2 = True And Feature3 = True Then
WshShell.Run (""APPDIR\file.exe"" /SILENT)
ElseIf Feature2 = True And Feature4 = True Then
WshShell.Run (""APPDIR\file.exe"" /SILENT)
ElseIf Feature2 = True And Feature3 = True And Feature4 = True Then
WshShell.Run (""APPDIR\file.exe"" /SILENT /INSTALL)
End If
但是由于某种原因,安装程序崩溃了。代码对我来说看起来不错并在外部执行?