More patch questions - 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!

mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

More patch questions

I was wondering if the properties of a patch file (msp), which presumably are accessed by msiexec, can be displayed in the patch dialog when the patch is installed? I would like to be able to display the actual name of the patch being installed.

Secondly, if the patch fails to install properly for some reason, can a custom error dialog be displayed with the reason for failure?

Finally, if there was a need to run a custom action of some sort when a fix (patch) is being installed, I'm curious about how this will work with patch sequencing and supersedence. What will trigger the execution of the custom action exactly?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

The patch UI can be modified in the "Path" section of the "Dialogs" page. To run a custom action when the patch is applied add the custom action to the upgraded project.

http://www.advancedinstaller.com/user-g ... tches.html

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

Ah. but I can't really access the properties of patch itself can I, such as its display name?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

A patch is the difference between two MSI file (target and upgraded). The patch UI can be customized in the "Dialogs" page, "Patch" section of your project.

Best Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

Hi Gigi...yes I know what an msp is, but that wasn't the question I was asking.

I need to be able to access the patch properties that exist, ultimately, only in the msp file, so that I can display the patch "display name" in the dialog at the welcome stage. I'm not sure whether the patch properties (as distinct from the msi properties) are accessible to the dialogs?

I'm just in the process of trying out some vbscript to enumerate the installed patches for a product - this might give me some clues on this.

--Milt
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

A patch can be applied only if the target image is already installed. So all Windows Installer properties are available for the patch. There are some properties that are available only for patch such as PATCH property.

To execute a custom action only when the patch is applied condition the custom action with the PATCH property. This property is set with the full path of the .msp file being applied:
http://msdn2.microsoft.com/en-us/library/aa370576.aspx

The patch dialogs customization can be done in the "Dialogs" page "Patch" section.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

Ah, OK ... so if we've got the actual name of the patch file, presumably we could use vbscript to open the msp file, in order to get properties of it for display such as the patch's DisplayName.?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I'm just in the process of trying out some vbscript to enumerate the installed patches for a product
Here is a link that could be helpful:
http://msdn2.microsoft.com/en-us/library/aa369558.aspx

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

Yeah, thanks Gigi for the link, but I already got past that point! I now have a vbscript that produces a complete list of all products and their installed patches. This is particularly useful on Win2000 servers where you can't see what patches have been installed.

Re your earlier reply about using the PATCH property - what I really need, in order to get the DisplayName of the patch, is the patch file's package id, rather than its file name. (Although the filename is better than nothing). It should be possible to open the patch file from script to find out this, but I wonder if this is allowed if the patch file has already been opened by Windows Installer.

...Milt
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

I'm not a vbscript expert. So my suggestion is to use a C++ DLL custom action:

First you need to obtain the patch code. You can obtain it by using the "MsiEnumPatchesEx" function:
http://msdn2.microsoft.com/en-us/library/aa370100.aspx

To get the display name of a patch you can use the "MsiGetPatchInfoEx" function:
http://msdn2.microsoft.com/en-us/library/aa370128.aspx

Here is an example on how to create a DLL custom action:
http://www.advancedinstaller.com/user-g ... n-dll.html

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
mctozzy
Posts: 81
Joined: Wed Feb 14, 2007 7:37 am

I'm hardly a vbscript expert myself, but I have had success doing what I want so far, and there seem to be much the same methods and params available as the C DLL's. Not having to go through compile/link/test cycles is pretty good for something like this.

Return to “Common Problems”