validate MSI online location (URL) before invoking msiexec - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

validate MSI online location (URL) before invoking msiexec

Hello,

My project is configured for an online / web install, whereby the bootstrapper downloads the MSI from a URL. I am also enforcing the "active Internet connection" prerequisite.

Assuming the "active Internet connection" prereq is satisfied, I am wondering if it is possible for the bootstrapper to validate the MSI location (URL) before invoking msiexec.exe. Currently, if the MSI cannot be located (due to an invalid URL or perhaps the server hosting the MSI has crashed) the user receives the following message from Windows Installer:
"This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer package."

The log file contains:
=== Verbose logging started: 4/2/2010 11:31:44 Build type: SHIP UNICODE 3.01.4001.5512 Calling process: C:\windows\system32\msiexec.exe ===
MSI (c) (98:D4) [11:31:44:390]: Resetting cached policy values
MSI (c) (98:D4) [11:31:44:390]: Machine policy value 'Debug' is 0
MSI (c) (98:D4) [11:31:44:390]: ******* RunEngine:
******* Product: http://<SANITIZED-FOR-PRIVACY>/BadURL/package.msi
******* Action:
******* CommandLine: **********
MSI (c) (98:D4) [11:31:44:390]: File path is a URL. Downloading file. . .
MSI (c) (98:D4) [11:31:44:437]: MSI WinHttp: Proxy Settings Proxy: (none) | Bypass: (none) | AccessType: 0
MSI (c) (98:D4) [11:31:44:453]: Download of URL resource http://<SANITIZED-FOR-PRIVACY>/BadURL/package.msi failed with last error 2
MSI (c) (98:D4) [11:31:44:453]: MainEngineThread is returning 2
=== Verbose logging stopped: 4/2/2010 11:31:44 ===

The message from WI is somewhat confusing to the average user - he/she may not realize (and shouldn't need to) that the boostrapper is part of an online / web install that requires additional resources. The message from WI gives the impression that the "setup.exe" file itself is somehow corrupt or incomplete.

Is it possible for the bootstrapper to validate the existence of the online MSI before invoking msiexec.exe? If the bootstrapper detects that the MSI cannot be found, it could present an error message with better wording and then it should not invoke msiexec.exe.

thanks for you help,
-Todd
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: validate MSI online location (URL) before invoking msiexec

Hi Todd,

I am afraid the message itself can not be customized. Nonetheless, try enabling integrity check for the prerequisite.
You might find the message a bit more appropriate when the download fails.

Let me know if this helped.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: validate MSI online location (URL) before invoking msiexec

Hi Gabriel,

Thank you for your reply.

I have already enabled integrity checks on the prereqs. One prereq is configured to install "during main MSI install" so it is downloaded after the MSI. The second prereq is global and installs before the main MSI, but it's just Windows Installer 2.0 (minimum version) which nearly every user already has, so the install condition is fulfilled and it is never downloaded. So, unfortunately, the integrity check on the prereqs doesn't help me.

Are there any other work-arounds that I could try (besides creating a "fake" prereq which is always installed and has the integrity check enabled) ?

I understand that the "This installation package could not be opened" message is generated directly by Windows Installer and not by Advanced Installer. However, I still think it would be useful (especially for projects which do not have any prereqs) if Advanced Installer could have an option whereby the bootstrapper verified the existence of online MSI files before invoking Windows msiexec.

thanks,
-Todd
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: validate MSI online location (URL) before invoking msiexec

Hello,

Sorry, it appears I misunderstood what you wanted. You were referring to the main .msi, not a prerequisite msi. The integrity check I suggested does not apply to this.
We currently do not check for the url. I have added an improvement on our TODO list to support this and it will be available in a future version of Advanced Installer.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: validate MSI online location (URL) before invoking msiexec

Hi Gabriel,

You are correct - I would like to validate the URL of the main MSI, not a prereq MSI.
Thanks for adding my request, I will look for this improvement in a future version of Advanced Installer.

-Todd
toddpatt
Posts: 111
Joined: Fri Jan 08, 2010 1:36 am

Re: validate MSI online location (URL) before invoking msiexec

Hello,

I've retested this scenario with both AI 7.6.1 and 7.7 and it seems the behavior has changed. If the (main) online MSI cannot be found, a new/different error message is now displayed, stating "The system cannot find the file specified."
AI - online MSI not found.JPG
AI - online MSI not found.JPG (7.43 KiB) Viewed 10855 times
Unfortunately, I think this new behavior is just as bad as the original behavior:

1) The title of the error-message window now says "Advanced Installer". This is confusing to the end-user, since he/she has no idea that Advanced Installer is the underlying framework. It would be much nicer to use the "ProductName" variable instead.

2) The error message is still very cryptic. Just as with the original behavior, the message is misleading and suggests that there is something wrong with the bootstrapper file itself. From the verbose log, it looks like the bootstrapper has access to the specific Windows error-code, so why not make the message more appropriate to the error? For example, the following message would be, in my opinion, much clearer:
"This setup program has dependencies on additional files which could not be located from their online location (ErrorCode: xxxxx). Please contact [Manufacturer] for help."

Or even better, allow the message to be configured in the .ail dictionary

Thanks for your help,
-Todd
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: validate MSI online location (URL) before invoking msiexec

Hello Todd,

The upcoming version of Advanced Installer is the one including the improvement for the check for msi at URL. It is scheduled for release soon. Let us know if the issue manifests itself after the update.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”