Here's some code (lightly cleaned) from one of my installers for setting up
some farm data in the product database table:
<Fragment>
<PropertyRef Id="HOST_NAME" />
<PropertyRef Id="SQL_SERVERNAME" />
<PropertyRef Id="SERVER_NAME" />
<PropertyRef Id="WEBSITE_SSLCERTHASH" />
<!-- locator for ProductServer -->
<sql:SqlDatabase Id="TheProductServer" Database="ProductServer"
Server="[SQL_SERVERNAME]" />
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="CmpUpdateProductServerForFarmAndHostName"
Guid="PUT-GUID-HERE" KeyPath="yes">
<sql:SqlString Id="SqlSetSslFarmAndHostName"
SqlDb="TheProductServer" User="DbUser" SQL="EXEC
[\[]ProductServiceAdmin[\]].[\[]SetSslFarmAndHostName[\]] @SslCertificateName =
'[SERVER_NAME]', @SslCertificateThumbprint = '[WEBSITE_SSLCERTHASH]', @HostFQDN
= '[HOST_NAME]', @ProductVersion = '[ProductVersion]'" ContinueOnError="no"
ExecuteOnInstall="yes" ExecuteOnReinstall="yes" ExecuteOnUninstall="no" />
</Component>
</DirectoryRef>
</Fragment>
--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.®
Shawnee Mission, KS 66227
Office: 913-341-3434 x791011
[email protected]
www.jackhenry.com
-----Original Message-----
From: John H Bergman (XPedient) [mailto:[email protected]]
Sent: Wednesday, August 28, 2013 9:55 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Can we dynamically modify .sql files at install time
Is there an example of this somewhere?
-----Original Message-----
From: John Cooper [mailto:[email protected]]
Sent: Wednesday, August 28, 2013 8:14 AM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Can we dynamically modify .sql files at install time
Yes. The easy way is to inline them as sql:SqlString elements. You can then
embed properties in them which allow you to dynamically change the SQL run. If
inlining them is an issue, you could have a template SQL file with substitution
tags in it, apply a custom action to make the substitutions, and then another
custom action to run it.
We use SqlString elements with embedded formatted properties in stored
procedures and short hunks of SQL to stick special values into tables
(primarily for farm awareness) or set up SQL permissions.
--
John Merryweather Cooper
Build & Install Engineer -- ESA
Jack Henry & Associates, Inc.®
Shawnee Mission, KS 66227
Office: 913-341-3434 x791011
[email protected]
www.jackhenry.com
-----Original Message-----
From: Arunkumar Parvathy (Consultant)
[mailto:[email protected]]
Sent: Wednesday, August 28, 2013 5:18 AM
To: [email protected]
Subject: [WiX-users] Can we dynamically modify .sql files at install time
Hi,
Am new to WiX, so excuse if my question is too naïve.
We use WiX to create msi for our product that will be installed in multiple
sites.
The product assumes a different behaviour for each site.
We achieve this by means of WiX Transforms.
I know that by using Wix, we can dynamically modify xml based
files(configuration files for eg) at installation time.
The question :
Is there any way to dynamically modify .sql files at install time, which too
are part of the installed package?
For eg: have a variable in the .sql file which can capture some value entered
through UI .
Another question, Is there any way to combine the contents of multiple .sql
files into a single .sql file during install time?
Reason behind the question:
We do not want Wix to run sql scripts on the DB while installing .
Just collate the modified script files in a folder under the Install Dir, which
the Installation team will later on run on the respective DB.
Thanks in advance,
PA
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and
advance your career. Get an incredible 1,500+ hours of step-by-step tutorial
videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are
intended exclusively for the individual or entity to which it is addressed. The
message, together with any attachment, may contain confidential and/or
privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or
distribution is strictly prohibited. If you have received this message in
error, please immediately advise the sender by reply email and delete all
copies.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and
advance your career. Get an incredible 1,500+ hours of step-by-step tutorial
videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies and
advance your career. Get an incredible 1,500+ hours of step-by-step tutorial
videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are
intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged
information.
Any unauthorized review, use, printing, saving, copying, disclosure or
distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users