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!

Jamals
Posts: 3
Joined: Sat Jun 09, 2018 9:38 am

Conditionally setting data path for installing sqlexpress

Hi,
In my installation project, I want determine the data location for installing sql express as a prerequisite base on a condition.
For example if the client machine has d: drive, then sql express default data location must be created on drive d:, otherwise, on drive c:.
Please let me know how to do this?
Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Conditionally setting data path for installing sqlexpress

Hello,

To achieve what you want you should add your SQL setup prerequisite as a feature-based prerequisite. Then, create your own custom action which search for the available drives on current machine and sets an installer property (e.g. SQL_INSTALL_PROP) to the desired installation path. Just have a look on our "Set an installer property using custom actions" article which should be useful.

Finally you should go to "Prerequisites" page, select your SQL prerequisite, go to "Setup Files" tab and in the "Install Command Lines" fields append a command line like this:

Code: Select all

/INSTANCEDIR=[SQL_INSTALL_PROP]
Also, please be aware that several version of the SQL Server Express could generate installation failures when scheduled as feature-based prerequisites.

Hope this helped.

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

Return to “Building Installers”