Aniki
Posts: 9
Joined: Thu Jun 28, 2018 8:25 am

Installing only attached database

Mon Jul 30, 2018 9:17 am

I would like to run my attached database script , if only user select "Server" from "ClientServerDlg". I tried to putting the condition "InstallMode = "Server" to the SQL Connection condition but it did not work. How can I do this ?

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing only attached database

Mon Jul 30, 2018 3:27 pm

Hello,

The execution of your script fails because you are conditioning it using a private property. Private properties values are not preserved upon moving from the "Wizard Dialogs Stage" to the "Install Execution Stage", their values being set back to their defaults. In this case, the value of "InstallMode" property when your script is running (in "Install Execution Stage" --> "Add Resources" action group) is "Typical", resulting in the failure of your script.

As a workaround, you can use a public property instead. Public properties values are preserved upon moving from the "Wizard Dialogs Stage" to the "Install Execution Stage".

To achieve those said above, you can go to "Dialogs" page, click on "ClientServerDlg" --> Click on the image placed to the left side of "Server" --> under "Published Events" tab click "New..." --> "Set installer property value" --> in the "Property" field specify the name of the public property which will store the value of "InstallMode" property (for example, you can name it INSTALLER_MODE) --> in the "Argument" field specify the value that your public property will have (in our case, the value is [InstallMode]) --> leave the condition field unchanged --> press "Ok".

Now that we have set the our public property to have the value of "InstallMode" private property, it is time to condition the execution of our SQL script. To do so, you can go to "SQL Databases" page and in condition tab, insert the following line:

Code: Select all

INSTALL_MODE = "Server"
Please note that INSTALL_MODE is the name we gave to the public property which stores the value of "InstallMode" private property. You can name this however you want.

Hope this helps!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Aniki
Posts: 9
Joined: Thu Jun 28, 2018 8:25 am

Re: Installing only attached database

Tue Jul 31, 2018 8:22 am

Thank you for your reply,

I did exactly what you proposed , but still it did not work. I might be making a small mistake .

- When I try to set installer propery value , it warns me that I am using a private value.

- I use the condition on Sql Connection, not on script. Because I do not want to connect SQL if the user selects other than Server.

- I get two recommendations when I try to insert the INSTALL_MODE condition to Sql Connection ; Typical , InstallMode .

Here is the screenshots :
Screenshot_2.png
Screenshot_2.png (154.34KiB)Viewed 4410 times
Screenshot_3.png
Screenshot_3.png (29.01KiB)Viewed 4410 times

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing only attached database

Tue Jul 31, 2018 3:03 pm

Hello,

I have tried to reproduce your scenario, but everything worked just fine.

In order for me to further investigate, can you please send us the .aip (project file) and a "verbose log" by e-mail at support at advancedinstaller dot com so we can investigate its settings?

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Aniki
Posts: 9
Joined: Thu Jun 28, 2018 8:25 am

Re: Installing only attached database

Tue Jul 31, 2018 3:18 pm

I created a new project, and configured the same settings and it worked. Still could not identify the problem with the previous .aip file but it resolved. Thank you for support.

Regards.

Catalin
Posts: 6544
Joined: Wed Jun 13, 2018 7:49 am

Re: Installing only attached database

Wed Aug 01, 2018 8:32 am

Hello,

You're always welcome!

I am glad you got this working!

Regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”