ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Is it possible to extract data from mysql table on server and create property at advanced installer using same

Is it possible to extract particular data (e.g. payment date) from mysql table on the server on the basis of serial no (server side validation) of the product being installed and create property at advanced installer using same data at the time of installation only (post installation method) ?

i.e in such case I would have to access mysql database on the server post successful server side validation and on the basis of serial number I would have to extract data from the row and create property.

How it can be achieved ? Either using prerequisite or custom action code ?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Hello,

This can be done using our "SQL Query" support. This feature allows you to run an SQL query against an SQL Server and map the result set to one or more installer properties. More exactly each column data of the result set can be mapped to an installer property.

Please have a look on our "Using an SQL Query to interrogate SQL databases" article for more details about how to implement this.

Also, here is a video tutorial about how to "Set MSI properties from SQL queries".

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Thanks for reply but I am using MySQL database , is it achievable using above mentioned method explained in video ?
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Yes, this is perfectly achievable for MySQL Server too. Just give it a try.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Yes it working with MySQL also. Can I use property in MySQL query also ?
Something like
Select edate from mytable where serial_no = '[PIDKEY]'
I tried but it is not working
If used static value for serial no like
Select edate from mytable where serial_no = '1483-F973-1806-9F08' ..then it is working fine.

How to use property in MySQL query ?
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Solved it with the help of script replacement... thanks

In between installation at the time of execution of MySQL query it display dialog ODBC...Querying Database...Is there any way to make this dialog invisible...so user will not see this dilog..
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Hello,

I'm glad you got this working.

To suppress the related querying message you should go to "Install Parameters" page and add a new property like this:
  • Property: SqlSuppressSpawnMsgBox
    Value: 1
Let us know if this doesn't work.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Property: SqlSuppressSpawnMsgBox
Value: 1

It worked...thanks lot
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Is there any way to delete user defined property or edit property from private to public and vice versa...

When I set a new property to grab data returned by MySQL Query and after that tried to set same property at combobox I am getting following error
"You are using a private property. Private property are reset when the installation passes from UI stage to Install execution stage. Public properties are recommended for capturing user input"
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

You are welcome.

You can edit the property name if from "Install Parameters" page. However, before being able to edit/delete the property name you should first make sure there are not any other fields into your project referring the above property.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Daniel wrote:You are welcome.

You can edit the property name if from "Install Parameters" page. However, before being able to edit/delete the property name you should first make sure there are not any other fields into your project referring the above property.

All the best,
Daniel
Amazing it worked...thanks...
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

You are always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Is it possible to connect database file (i.e SQLite database in my case) in application folder at advanced installer ?
I created new connection at SQLite and at Database entered [APPDIR]mydb.s3db ...when tried to test query it showed error message that
"File not found: mydb.s3db"
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Hello,

This may happen if the query is ran before the file gets actually deployed on target machine at install time.

Can you please add the database file as a temporary file in "Files and Folders" page and see if this helped?

Regular files are deployed at install time after you clicked on [Install] button during the "Install Execution Stage -> Add Resources" action group on deferred execution mode.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ninadbe
Posts: 11
Joined: Wed Aug 02, 2017 4:17 pm

Re: Is it possible to extract data from mysql table on server and create property at advanced installer using same

Configured mysql server at SQL Database tab of advanced installer by creating a new predefined connection with connection type MySQL Server and downloaded mysql odbc 5.3 Unicode driver from the mysql website and installed it. Connection worked fine after installation and configuration of mysql odbc 5.3 unicode driver.

When tried to run the setup on the another PC it gave error regarding DLL file required for installation to be completed, so added mysql server 5.3 as a prerequisite installation. But with prerequisite it runs mysql driver setup before actual installation begins, It is time consuming and confusing process , Is there any other alternative or easiest way to achieve it so that mysql driver setup would be inbuilt to main program setup it wont prompt separately ?

Thanking you.

Return to “Common Problems”