0
運行我的安裝程序的條件之一是註冊表中的值應該與「1」不同,否則會顯示錯誤消息並退出。如何讓用戶只有在給定的註冊表項沒有特定的值時才能安裝?
這不能通過自定義操作完成,因爲即使在安裝後發生OnBeforeInstall
事件,所以用戶可以在回滾之前終止安裝。
如果我是用維克斯這將是simples作爲
我怎麼可以這樣做沒有維克斯?
運行我的安裝程序的條件之一是註冊表中的值應該與「1」不同,否則會顯示錯誤消息並退出。如何讓用戶只有在給定的註冊表項沒有特定的值時才能安裝?
這不能通過自定義操作完成,因爲即使在安裝後發生OnBeforeInstall
事件,所以用戶可以在回滾之前終止安裝。
如果我是用維克斯這將是simples作爲
我怎麼可以這樣做沒有維克斯?
您需要爲您的MSI文件生成JScript腳本。或者你可以在Orca手動完成。
var installer = WScript.CreateObject("WindowsInstaller.Installer");
var filespec = WScript.Arguments(0);
var msiOpenDatabaseModeTransact = 1;
var database = installer.OpenDatabase(filespec, msiOpenDatabaseModeTransact);
Execute("INSERT INTO `AppSearch` (`Property`, `Signature_`) VALUES ('SOMESOFTWAREVERSION', 'SomeSoftwareVersion')");
Execute("INSERT INTO `RegLocator` (`Signature_`, `Root`, `Key`, `Name`, `Type`) VALUES ('SomeSoftwareVersion', 2, 'SOFTWARE\\Some Manufacturer\\SomeSoftware', 'SomeSoftwareVersion', 2)");
Execute("INSERT INTO `LaunchCondition` (`Condition`, `Description`) VALUES ('SOMESOFTWAREVERSION <> \"#1\"', 'This application cannot be installed with SOMESOFTWARE v1. Setup now will exit.')");
function Execute(sql) {
view = database.OpenView(sql);
view.Execute();
view.Close();
}
它會檢查Wow6432Node在64位Windows一樣維克斯確實