abiram
Posts: 7
Joined: Wed Mar 12, 2008 5:51 am

Create Patch MSI file

hi,

I am new to Advance installer. I want to make a patch msi file for my appliaction. In patch i want to update some dll's, run sql scripts for database and update my application exe also.

if i uninstall the patch msi from add\remove programs still my appliaction should work. how can i do it using advance installer.


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

Hi,
I want to make a patch msi file for my appliaction. In patch i want to update some dll's, run sql scripts for database and update my application exe also.
We have a patch tutorial, please take a look:
http://www.advancedinstaller.com/user-g ... patch.html

Also, you can read more about patches here:
http://www.advancedinstaller.com/user-g ... tches.html
http://www.advancedinstaller.com/user-g ... oject.html
if i uninstall the patch msi from add\remove programs still my appliaction should work. how can i do it using advance installer.
In order to uninstall a patch from the Control Panel, the patch must be installed with Windows Installer 3.0 or higher. Also, you must set the "Allow patch removal" option in the "Add/Remove (Control Panel)" page of your patch project.

Note that the patch must meet the conditions explained here:
http://msdn2.microsoft.com/en-us/library/aa371212.aspx
http://msdn2.microsoft.com/en-us/librar ... S.85).aspx

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
abiram
Posts: 7
Joined: Wed Mar 12, 2008 5:51 am

hi,

in this how can i update the database with sql script. In sql script i want to change the replace some of the values according to the old application installed values.

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

Hi,

In order to include an SQL Script in a patch, you need to make sure that the script is included only in the Upgraded package (and not in the Target package). This way, when the patch is built the SQL script is included in it.

We have a tutorial for using SQL Scripts, please take a look:
http://www.advancedinstaller.com/user-g ... l-sql.html
http://www.advancedinstaller.com/user-guide/sql.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

Re: Create Patch MSI file

hi,

I add sql script in the upgrade project. After adding i created a patch. but the sql script is not running.

eg:

I created a sample project with version 2.0.1.

then i changed the version to 2.0.2 and added sql script.

Sql Script :
Connection : Driver={SQL Native Client};Server=.\SQLExpress;Database=Test;Trusted_Connection=Yes

script file name : mytable.sql
the sql contains only one line
CREATE TABLE MyCustomers (CustID int IDENTITY (100,1) PRIMARY KEY, CompanyName nvarchar (50))

after that i created patch.

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

Re: Create Patch MSI file

Hi,

I'm not sure why you are encountering this behavior. Can you please send us the AIP which shows this problem to support at advancedinstaller dot com so we can investigate it? Also, can you please give me more details about how the script fails? Do you get an error message?

If you don't receive any error messages perhaps the table in the script is created in another database. Have you checked the other databases?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Create Patch MSI file

Hi Kiran,

You are encountering this behavior because of the condition used by the SQL script (it is a small bug in Advanced Installer and it will be fixed in a future version). In order to fix this you can follow these steps:
- open the AIP with a text editor
- find the "caphyon.advinst.msicomp.MsiInstExSeqComponent" component
- find the "AI_SqlInstall" action under this component
- replace the "(VersionNT >= 500) AND (NOT Installed)" condition with "REMOVE<>"ALL""
- open the AIP in Advanced Installer and build it
- open the patch project, refresh the images and build it

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

Return to “Common Problems”