What can Patches do? - 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!

vulgrin
Posts: 40
Joined: Fri Jan 11, 2008 9:49 pm

What can Patches do?

I posted the previous message about getting patches to work in the autoupdater, but then had a thought. Our application will be setting up and connecting to a SQL Server database, which we planned on doing during the install.

But what happens if we need to alter that database? For example, we might need to patch the app and make a structural change to our database. Is that something that we would be able to do with a MSP? Or are we going to need to have the user do an upgrade and run a full MSI?

And if I were to, say, write my own EXE that handles complicated database updates, which I believe I can call from the MSI - would I be able to do that from a MSP?

Is there anyone else out there doing this that could tell me how you have it set up? Sorry, I'm very, very new to installers so I'm having some trouble getting up to speed on the more complicated situations.

Thanks
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

A patch is basically the difference between two MSI packages, therefore it includes only the changes made to the old MSI (not the entire installation).

Since in a patch you cannot use an User Interface to let the end user configure the database, you can use a custom action for this. Note that this custom action must be present only in the upgraded MSI, otherwise it will not be included in the patch.
And if I were to, say, write my own EXE that handles complicated database updates, which I believe I can call from the MSI - would I be able to do that from a MSP?
Yes, you can use this EXE, but it needs to be included in the patch (like I explained above).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vulgrin
Posts: 40
Joined: Fri Jan 11, 2008 9:49 pm

Re: What can Patches do?

Ok, after four months since I originally posted this, I'm ready to attempt it. :)

So I tried it, and I have successfully created two MSI, version 1 and version 1.1. Version 1.1 adds a "migrator.exe" exe to the fileset and has a custom action during install to run the EXE.

If I install the 1.1 by itself, this EXE gets run and comes up fine.
If I create a patch between 1.0 and 1.1, then uninstall everything and run 1.0 then the MSP, then the EXE is getting dropped into the file folder, but the custom action isn't running after the patch installs.

Any ideas?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: What can Patches do?

Hi,

In order to run a custom action while a patch is applied you need to condition it with the "PATCH" property. Therefore, in your case the condition of the custom action will be:

Code: Select all

(Not Installed) AND PATCH
Let me know if the problem persists even when using this condition.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
vulgrin
Posts: 40
Joined: Fri Jan 11, 2008 9:49 pm

Re: What can Patches do?

I had to use (Not Installed) OR PATCH, but yes it worked!

Actually, I realized that I only need to run this exe during a patch, so setting it to just PATCH works fine. I assume that this will work if I do an upgrade version, or is there an "UPGRADE" property I can check? Or does (Not Installed) work for both upgrades and new installs? (but not patches)

Thanks for all your help cosmin - we're definitely going to be a customer, and all of your excellent and swift support is the key reason why. I'll be recommending this software to everyone I know, thanks to you.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: What can Patches do?

Hi,
I assume that this will work if I do an upgrade version, or is there an "UPGRADE" property I can check?
If you use the automated upgrade feature you can run a custom action in the package which is being upgraded by using this condition:

Code: Select all

(UPGRADINGPRODUCTCODE)
However, if you want to run a custom action when the package upgrades an older version, you can use:

Code: Select all

OLDPRODUCTS
If you have other questions, don't hesitate to ask.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”