Javascript MSI的HTA安装程序失败
我正在使用HTA尝试将WindowsInstaller.Installer作为ActiveXObject安装产品。使用过去使用过的相同HTA模型,尝试安装时会抛出错误:“Msi API错误:InstallProduct、PackagePath、PropertyValue” 我在WindowsVista和Server2003上都尝试过,但没有成功。他们都在使用IE8,所以我认为这可能是某种ActiveX兼容性问题。然后,我在IE6中对其进行了测试,遇到了同样的问题——然而,我们在过去多次成功地将这种格式用于HTA。我试图从两台机器上的管理员帐户安装,MSI本身按预期执行 到目前为止,我尝试了以下方法:Javascript MSI的HTA安装程序失败,javascript,internet-explorer-8,windows-installer,hta,failed-installation,Javascript,Internet Explorer 8,Windows Installer,Hta,Failed Installation,我正在使用HTA尝试将WindowsInstaller.Installer作为ActiveXObject安装产品。使用过去使用过的相同HTA模型,尝试安装时会抛出错误:“Msi API错误:InstallProduct、PackagePath、PropertyValue” 我在WindowsVista和Server2003上都尝试过,但没有成功。他们都在使用IE8,所以我认为这可能是某种ActiveX兼容性问题。然后,我在IE6中对其进行了测试,遇到了同样的问题——然而,我们在过去多次成功地将这
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 install software.");
}
// Check the install status of the MSI to ensure it is in the registry
RegistryKeyExists(i);
}
然后在单击“安装”按钮时调用该方法,如下所示
卸载安装
我在谷歌上搜索了很多次,只在有人试图安装Silverlight 3时发现了一个相关的问题(显然已经修复了)。有什么想法吗?我的安装集也有类似的问题 我使用VBScript并启动MSI
Set sh = CreateObject("WScript.Shell")
l_command = "%SystemRoot%\System32\msiexec.exe /i """ & sh.CurrentDirectory & "\" & p_file & """"
sh.Exec l_command
您是否尝试过在windows脚本主机.wsf文件而不是HTA下运行相同的脚本?如果是这样的话,结果是一样的吗?我已经在XP机器上运行了你的示例,没有管理帐户,它可以工作。(仅删除了
“显示:无;可见性:隐藏;”“
),因此它可能是Vista/2003特有的?它似乎在Windows 7上对我很好。您是否已检查应用程序事件日志(应来自MSInstaller)中的真实错误代码?另一件值得尝试的事情可能是在注册表中启用Windows Installer日志: