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!

deatiit86
Posts: 13
Joined: Sat Nov 10, 2012 3:13 am

SQL script output and logged-in user as Property

Hi,

I have two questions...

1) I have created a dialog which requests the input of a username and password. I'd like to display the logged-in user using the windows domain\username format as the default value in the input field.

2) I have created a SQL script that when run checks data in a table to verify that some mimimum schema requirements are met. How can I capture this data and check that it meets the requirements? Can a property be created to capture the results of the SQL script?

Thanks.
-Arun
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL script output and logged-in user as Property

Hello Arun,
1) I have created a dialog which requests the input of a username and password. I'd like to display the logged-in user using the windows domain\username format as the default value in the input field.
In order to achieve this you can set your USER_PROP property (associated with your user edit box) using the USERDOMAIN and USERNAME environment variable. Just go to "Custom Actions" page and add a "Set installer property" custom action with sequence, scheduled after "Wizard Dialogs Stage -> Searches" action group, like this:
  • Property: USER_PROP
    Formatted: [%USERDOMAIN]\[%USERNAME]
2) I have created a SQL script that when run checks data in a table to verify that some mimimum schema requirements are met. How can I capture this data and check that it meets the requirements? Can a property be created to capture the results of the SQL script?
Currently we don't have support for this. However, this improvement was on our TODO list and it was already implemented in our next version of Advanced Installer (10.1) which is in testing phase and should be released very soon.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
deatiit86
Posts: 13
Joined: Sat Nov 10, 2012 3:13 am

Re: SQL script output and logged-in user as Property

Thanks. That did it.

Looking forward to the 10.1 release.

I do have more questions - I will start another topic.

Thanks again.
-Arun
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL script output and logged-in user as Property

You're welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
deatiit86
Posts: 13
Joined: Sat Nov 10, 2012 3:13 am

Re: SQL script output and logged-in user as Property

Hi there,

This is with regard to capturing the SQL script output. I have downloaded and am using AdvancedInstaller 10.1. I have a script that returns 4 values and I have it setup to capture the data. But the output never seems to get assigned to the values. I get the following in the log file (using /L*V when installing):

MSI (c) (BC:DC) [15:59:02:930]: Doing action: AI_DATA_SETTER_4
Action 15:59:02: AI_DATA_SETTER_4.
Action start 15:59:02: AI_DATA_SETTER_4.
MSI (c) (BC:DC) [15:59:02:931]: PROPERTY CHANGE: Adding CustomActionData property. Its value is 'CheckDBVersionAndSchema'.
Action ended 15:59:02: AI_DATA_SETTER_4. Return value 1.
MSI (c) (BC:DC) [15:59:02:931]: Doing action: SqlQueryAction
Action 15:59:02: SqlQueryAction.
Action start 15:59:02: SqlQueryAction.
MSI (c) (BC:34) [15:59:02:933]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\2\MSI5EEF.tmp, Entrypoint: OnSqlFetch
SqlQueryAction:
SqlQueryAction:
MSI (c) (BC!08) [15:59:04:326]: PROPERTY CHANGE: Deleting DB_VERSION_NAME property. Its current value is 'SQL Server'.
MSI (c) (BC!08) [15:59:04:326]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:327]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:327]: PROPERTY CHANGE: Deleting DB_VERSION_SUPPORTED property. Its current value is '0'.
MSI (c) (BC!08) [15:59:04:327]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:328]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:328]: PROPERTY CHANGE: Deleting DB_SCHEMA_VERSION property. Its current value is '10.x'.
MSI (c) (BC!08) [15:59:04:328]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:329]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:329]: PROPERTY CHANGE: Deleting DB_SCHEMA_SUPPORTED property. Its current value is '0'.
MSI (c) (BC!08) [15:59:04:329]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (BC!08) [15:59:04:330]: Note: 1: 2262 2: ListBox 3: -2147287038
Action ended 15:59:04: SqlQueryAction. Return value 1.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL script output and logged-in user as Property

Hello Arun,

Can you please send us the .AIP (project file) and a verbose log of the installation to support at advancedinstaller dot com so we can investigate them?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
deatiit86
Posts: 13
Joined: Sat Nov 10, 2012 3:13 am

Re: SQL script output and logged-in user as Property

Just sent over. Thanks.
deatiit86
Posts: 13
Joined: Sat Nov 10, 2012 3:13 am

Re: SQL script output and logged-in user as Property

I followed your recommendation to change the script so that it has only one select. Now the values are being set correctly. But right after setting the values it says that the return value is 3 and exits the installation. The log section is as follows (see that is has correctly set the values for DB_VERSION_NAME and DB_VERSION_SUPPORTED - which is what the select returns):

Action 8:56:51: CheckDBVersion.
Action start 8:56:51: CheckDBVersion.
MSI (c) (F4:D0) [08:56:51:482]: Invoking remote custom action. DLL: C:\Users\ADMINI~1\AppData\Local\Temp\2\MSIEE49.tmp, Entrypoint: OnSqlFetch
MSI (c) (F4!D0) [08:56:51:571]: PROPERTY CHANGE: Deleting DB_VERSION_NAME property. Its current value is 'SQL Server'.
MSI (c) (F4!D0) [08:56:51:571]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:572]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:572]: PROPERTY CHANGE: Deleting DB_VERSION_SUPPORTED property. Its current value is '0'.
MSI (c) (F4!D0) [08:56:51:572]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:573]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:665]: PROPERTY CHANGE: Adding DB_VERSION_NAME property. Its value is 'SQL Server 2008 R2 RTM Standard Edition (64-bit)'.
MSI (c) (F4!D0) [08:56:51:665]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:665]: Note: 1: 2262 2: ComboBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:666]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:666]: Note: 1: 2262 2: ListBox 3: -2147287038
MSI (c) (F4!D0) [08:56:51:667]: PROPERTY CHANGE: Adding DB_VERSION_SUPPORTED property. Its value is '1'.
MSI (c) (F4:D0) [08:56:51:685]: Leaked MSIHANDLE (199) of type 790540 for thread 3536
MSI (c) (F4:D0) [08:56:51:693]: Leaked MSIHANDLE (193) of type 790541 for thread 3536
Action ended 8:56:51: CheckDBVersion. Return value 3.
Info 2896. Executing action CheckDBVersion failed.
Action ended 8:56:51: WelcomeDlg. Return value 3.
MSI (c) (F4:CC) [08:56:51:694]: Doing action: FatalError
Action 8:56:51: FatalError.
Action start 8:56:51: FatalError.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: SQL script output and logged-in user as Property

Hello,

From what I see in your log section it seems that your "CheckDBVersion" custom action fails. Please take a look on "Logging of Action Return Values" article.

Can you please try to manually run the SQL script within "CheckDBVersion" action on target machine and see if succeed?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”