How does 'SQL Script Replace' work? - Advanced Installer Community

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!

aldebaran
Posts: 23
Joined: Wed Dec 05, 2007 4:04 pm
Location: Hannover, Germany
Contact: Website

How does 'SQL Script Replace' work?

I noticed the [Script replacements] in SQL Scripts section. Can this be used to replace strings in my SQL files while installing?

The background: I want to run a SQL script to create a (MSSQL) database with specific file- and foldernames. The folder should be the Install-Folder that the user selected earlier.

Can this be used to to this?

Greetings
Stefan Hackenthal
aldebaran.de
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi Stefan,
I noticed the [Script replacements] in SQL Scripts section. Can this be used to replace strings in my SQL files while installing?
Please note that the Script Replacement feature allows you to replace strings in you SQL script. These modifications will be performed when you build the project (not at runtime).
I want to run a SQL script to create a (MSSQL) database with specific file- and foldernames. The folder should be the Install-Folder that the user selected earlier.
For this you can use the APPDIR property in your script. Since the "Replace with" field in the "SQL Script Replace" dialog is formatted, you can replace the folder in your script with the [APPDIR] property.

In this case, the folder in the script will be replaced with APPDIR when you build the project. Also, when the script is run APPDIR will be replaced by the value set by the user during the installation process.

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

Return to “Common Problems”