Glad you got that working, Nicolas. You're following a path we're considering 
for future releases of AdventureWorks (that's pretty much what we're doing for 
the T-SQL scripts to build the databases now); thanks for sharing your 
learnings. We're also considering PowerShell and/or DTF. We're leaning toward 
DTF because of the unit testability. We're pretty sure that expecting the .NET 
Framework to be on a target machine is reasonable because it's a prerequisite 
for SQL Server these days.

Note: ASCMD (even in binary form) also requires that the .NET framework be 
installed on the target machine, just like your custom C# executable (that's 
all ASCMD is).



-----Original Message-----
From: Nicolas Bryant [mailto:n...@manpowersoftware.com]
Sent: Wednesday, January 14, 2009 09:28
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Creating a SQL Analysis Services DB

As I've had no response to this, I suppose I may as well post the
"solution" I've cobbled together:

The installation contains ascmd.exe as a "binary", and installs the
.xmla script and also a .cmd file to the Windows temp folder. A custom
action then uses ascmd to execute the .xmla script. (The server included
in the ascmd command-line is derived from a property set by the
installation GUI). A second custom action launches the .cmd file which
deletes the .xmla script, and also the .cmd file itself.

I did try a few other possibilities but none of them worked out. Making
.xmla a "binary" didn't work because I couldn't figure out how to
dynamically modify a binary file. (I'm also not sure if one binary file
can be used as the argument of another). I also tried using a VBScript
custom action to delete the files, but that failed because the script
had to be executed *before* InstallFinalize while (for some reason I
don't fully understand) using ascmd to run the .xmla script only
executes without erroring if it happens *after* InstallFinalize. I also
tried using a little C# executable to do the file deletion (held as a
binary); that did work, but wasn't allowable because it would require
the .NET run-time to be installed on the box where the setup programme
was running.


> -----Original Message-----
> From: Nicolas Bryant [mailto:n...@manpowersoftware.com]
> Sent: Monday, January 12, 2009 5:50 PM
> To: wix-users@lists.sourceforge.net
> Subject: [WiX-users] Creating a SQL Analysis Services DB
>
> Hello all.
>
>
>
>  First thing to say is that I'm an Extreme Newbie(tm) when it comes to
> Wix, so please be gentle! *anxious smile*
>
>
>
> Okay, what I'm trying to do is to create a SQL analysis services DB as
> part of the installation. I've managed to add some GUI which sets the
> value of some properties that store the name of the server (we assume
> for the moment that the server has analysis services installed) and
the
> name of the database that we're going to create. The GUI also captures
> the server, db, user and password for the SQL database that the
analysis
> services DB is based on. My automated build process creates a .xmla
> script file which (I hope) can be used to construct the database
(which
> includes some dimensions and a cube), but it will need to have the
> connection string for the SQL database configured dynamically as part
of
> the install.
>
>
>
> I've a few months of C# experience, but no experience at all with C++
or
> VBScript, so I would prefer to avoid writing a C++ DLL or some
VBScript
> to handle this. (As I said above, I'm VERY new to Wix).
>
>
>
> Now, Microsoft distributes a utility called ascmd which (I think) can
be
> used to execute a .xmla script against the server to create the AS
> database. My first thought therefore was that I could use a Wix
> CustomAction to run ascmd with the .xmla script. (Does this seem
> reasonable?)
>
>
>
> I can't, however, work out a comfortable way of doing this. I could
> perhaps install ascmd and the .xmla file to the Windows temp folder. I
> could then modify the .xmla file dynamically to include the correct
> connection string and then delete them at the end of the install. I
can
> get most of that working, but not the eventual deletion. In any case,
> this would presumably mess things up on the uninstall, as files that
had
> been a part of the install would no longer be there...?
>
>
>
> I know that there is supposed to be a way to bundle files into the Wix
> installation package that are not actually installed, but I can't
figure
> out how to do that, either. (I know it's something to do with a
<Binary>
> tag, but the correct syntax and location to include it elude me). And,
> if I do somehow manage to bundle (but not install) the files, how do I
> dynamically change the connection string property in the .xmla file?
And
> how do I then launch ascmd correctly/
>
>
>
> Any suggestions would be welcome!
>
>
>
> Rgds,
>
>
>
> Nicolas.
>
>
>
> This e-mail is intended only for the person to whom it is addressed.
It may
> contain confidential information and/or privileged material.  If you
receive
> this in error, please notify the sender immediately and delete the
> information from your computer; please do not copy or use it for any
purpose
> nor disclose its contents to any other person.
>
------------------------------------------------------------------------
-----
> -
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to