0

我想实现这样的事情: Run exe after msi installation?添加启动复选框MSI安装程序

但我的问题是,我需要2个复选框推出2个不同的前男友。 我复制了代码并尝试进行更改。留下我想知道:

  • 什么字段是每个复选框独特的?

抑或只是不可行?

部分js文件:

//First CHECKBOX 
WScript.Echo("Adding FirstCheckbox..."); 

     var fileId = FindFileIdentifier(database, expertFilename); 
     if (!fileId) 
       throw "Unable to find '" + expertFilename + "' in File table"; 

     appName = "Rating" 

     WScript.Echo("Updating the Control table..."); 
     // Modify the Control_Next of BannerBmp control to point to the new CheckBox 
     sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE `Dialog_`='FinishedForm' AND `Control`='BannerBmp'"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     record = view.Fetch(); 
     record.StringData(11) = "CheckboxLaunch"; 
     view.Modify(msiViewModifyReplace, record); 
     view.Close(); 

     // Insert the new CheckBox control 
     sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) VALUES ('FinishedForm', 'CheckboxLaunch', 'CheckBox', '9', '201', '343', '12', '3', 'LAUNCHAPP', '{\\VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + appName + "', 'CheckboxLaunch1', '|')"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     view.Close(); 


     WScript.Echo("Updating the ControlEvent table..."); 
     // Modify the Order of the EndDialog event of the FinishedForm to 1 
     sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND `Event`='EndDialog'"; 


     view = database.OpenView(sql); 
     view.Execute(); 
     record = view.Fetch(); 
     record.IntegerData(6) = 1; 
     view.Modify(msiViewModifyReplace, record); 
     view.Close(); 

     // Insert the Event to launch the application 
     sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton', 'DoAction', 'VSDCA_Launch', 'LAUNCHAPP=1', '0')"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     view.Close(); 



     WScript.Echo("Updating the CustomAction table..."); 
     // Insert the custom action to launch the application when finished 
     sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch', '210', '" + fileId + "', '')"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     view.Close(); 

     if (checkboxChecked) 
     { 
       WScript.Echo("Updating the Property table..."); 
       // Set the default value of the CheckBox 
       sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP', '1')"; 
       view = database.OpenView(sql); 
       view.Execute(); 
       view.Close(); 
     } 

     database.Commit(); 

//Other CHECKBOX 
WScript.Echo("Adding other Checkbox..."); 


     fileId = FindFileIdentifier(database, micsFilename); 
     if (!fileId) 
       throw "Unable to find '" + micsFilename + "' in File table"; 


     appName = "Policy Managment" 

     WScript.Echo("Updating the Control table..."); 
     // Modify the Control_Next of BannerBmp control to point to the new CheckBox 
     sql = "SELECT `Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help` FROM `Control` WHERE `Dialog_`='FinishedForm' AND `Control`='BannerBmp'"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     record = view.Fetch(); 
     record.StringData(11) = "CheckboxLaunch1"; 

     // view.Modify(msiViewModifyReplace, record); 
     view.Close(); 

     // Insert the new CheckBox control 
     sql = "INSERT INTO `Control` (`Dialog_`, `Control`, `Type`, `X`, `Y`, `Width`, `Height`, `Attributes`, `Property`, `Text`, `Control_Next`, `Help`) VALUES ('FinishedForm', 'CheckboxLaunch1', 'CheckBox', '9', '201', '343', '12', '3', 'LAUNCHAPP2', '{\\VSI_MS_Sans_Serif13.0_0_0}" + checkboxText + appName + "', 'CloseButton', '|')"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     view.Close(); 


     WScript.Echo("Updating the ControlEvent table..."); 
     // Modify the Order of the EndDialog event of the FinishedForm to 1 
     sql = "SELECT `Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering` FROM `ControlEvent` WHERE `Dialog_`='FinishedForm' AND `Event`='EndDialog'"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     record = view.Fetch(); 
     record.IntegerData(6) = 1; 
     view.Modify(msiViewModifyReplace, record); 
     view.Close(); 

     // Insert the Event to launch the application 
     sql = "INSERT INTO `ControlEvent` (`Dialog_`, `Control_`, `Event`, `Argument`, `Condition`, `Ordering`) VALUES ('FinishedForm', 'CloseButton', 'DoAction', 'VSDCA_Launch1', 'LAUNCHAPP2=1', '0')"; 

     view = database.OpenView(sql); 
     view.Execute(); 
     view.Close(); 

     WScript.Echo("Updating the CustomAction table..."); 
     //Insert the custom action to launch the application when finished 
     sql = "INSERT INTO `CustomAction` (`Action`, `Type`, `Source`, `Target`) VALUES ('VSDCA_Launch1', '210', '" + fileId + "', '')"; 
     view = database.OpenView(sql); 
     view.Execute(); 
     view.Close(); 

     if (checkboxChecked) 
     { 
       WScript.Echo("Updating the Property table..."); 
       // Set the default value of the CheckBox 
      sql = "INSERT INTO `Property` (`Property`, `Value`) VALUES ('LAUNCHAPP2', '1')"; 
      view = database.OpenView(sql); 
      view.Execute(); 
      view.Close(); 
     } 

     database.Commit(); 
     WScript.Echo("Done..."); 
+0

目前它创建一个复选框,这将启动这两个应用程序,我需要两块推出基于所检查每一个。 – GRush 2011-06-10 17:22:25

+0

目前的问题是,一个复选框不会出现,直到我把鼠标移动(可能导致重绘?) – GRush 2011-06-10 17:59:22

回答

0

CheckBox控件具有独特的到它的多个属性,但是你在属性名,属性值和文本最感兴趣。复选框属性值用于确定是否执行启动文件的自定义操作。

如果您遇到的问题,您应该提供关于究竟是不行的更多细节。

+0

我只得到一个复选框,当检查两个前男友正在启动。我可以提供我正在使用的.js – GRush 2011-06-10 17:07:20

+0

进一步检查我的代码后,我发现我错误地勾选了相互之间的复选框。 > _ < – GRush 2011-06-10 17:31:10