我正在使用HTA尝试使用WindowsInstaller.Installer作为ActiveXObject安装产品.使用过去使用的相同HTA模型,安装尝试会抛出错误:"Msi API错误:InstallProduct,PackagePath,PropertyValues".
我在Windows Vista和Server 2003上都试过这个,但没有成功.两者都使用IE8,所以我认为它可能是某种ActiveX兼容性问题.然后我在IE6中对它进行了测试并遇到了同样的问题 - 但是,我们过去曾多次将这种格式用于HTA并取得了成功.我试图从两台计算机上的管理员帐户安装,并且MSI本身按预期执行.
到目前为止,我尝试了以下内容:
这是失败的方法/上下文:
var Software = new Array(
new Array("..\\Software\\Product.msi", "ProductCode"));
function run_msi(i)
{
try
{
//Execute MSI application install on error resume next
var msi = new ActiveXObject("WindowsInstaller.Installer");
var installer = Software[i][0];
msi.UILevel = 5; // full interactive mode
msi.InstallProduct(installer, "");
}
catch (e)
{
alert ("Unable to launch the Installer Package. This may be because you do not have permission to …Run Code Online (Sandbox Code Playgroud) javascript windows-installer hta failed-installation internet-explorer-8