I'm using a HTA to try to install a product using WindowsInstaller.Installer as an ActiveXObject. Using the same HTA model that has been used in the past, the attempt to install throws the error: "Msi API Error: InstallProduct,PackagePath,PropertyValues".
I have tried this on both Windows Vista and Server 2003 with no success. Both have been using IE8, so I thought it might be some sort of ActiveX compatibility problem. I then tested it in IE6 and encountered the same problem - however, we have used this format for HTAs several times in the past with success. I am attempting to install from an Administrator account on both machines, and the MSI itself executes as expected.
So far I have tried the following:
Here is the method/context that is failing:
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);
}
The method is then called when clicking on an "install" button as follows
<td><span class="link" style="display: none; visibility: hidden" id="SoftwareTextTrue0"
onclick="javascript:run_msi(0);">Uninstall</span> <span class="link" style="display: none;
visibility: hidden" id="SoftwareTextFalse0" onclick="javascript:run_msi(0);">Install</span>
</td>
I have Googled extensively and only found a related issue when someone was trying to install Silverlight 3 (which has apparently since been fixed). Any ideas?
I have a similar problem with my install set.
I used a VBScript and start the MSI
Set sh = CreateObject("WScript.Shell")
l_command = "%SystemRoot%\System32\msiexec.exe /i """ & sh.CurrentDirectory & "\" & p_file & """"
sh.Exec l_command
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With