Variables Not Replaced In Sql Script ?

Got a problem you cannot solve? Try here.
Yort
Posts: 12
Joined: Thu May 25, 2006 11:48 pm

Variables Not Replaced In Sql Script ?

Postby Yort » Sun Jul 16, 2006 9:58 pm

Hi All (again),

So I've got my sql scripts executing now, but the scripts that insert default data into my tables aren't working properly. Specifically, the data inserted isn't having variables replaced with their values.

For example, in some cases I insert the value $TARGETDIR$\\Installations\\1 into a table. When I check the database after install, the column contains $TARGETDIR$\\Installations\\1 instead of c:\\program files\\myapplication\\Installations\\1. There are a number of other values (machine names, IP Addresses, user entered values) that I also want to replace in various insert statements.

It's worth noting the scripts I'm running are loaded using the #FILESCRIPT# syntax. Do scripts executed this way support variable replacement ? If not, why not and how can I get around this ? The scripts are very large and I don't want to embed them in the install itself because of the problem where large scripts make the install look like it's hung.Am I doing something wrong ?

Thanks.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jul 17, 2006 2:32 am

This is a known issue with the current version and has been fixed. You have two alternatives:

1) Use the attached, updated plug-in DLL. Place this in your InstallAware\\Plug-Ins\\MS SQL Server folder, overwriting the old copy of the DLL. Then rebuild your setups and test again.

2) Use the EditFile plug-in to replace variables before calling your script. This is a workaround you may use without having to update the product DLL.

File Attached:

mMSSQLExec.zip
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Yort
Posts: 12
Joined: Thu May 25, 2006 11:48 pm

Postby Yort » Mon Jul 17, 2006 4:26 pm

Thanks, I'll try the updated DLL. It's Awesome there's a fix available already :D


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 181 guests