I figured out the first issue - as mentioned before, I ask for the user's
credentials upon uninstallation too.

The 2nd issue is still not resolved. I have tried various combinations of
passing credentials, Rob, and none of them seem to work. The only action
that I am able to perform successfully is the one upon installation - WIX
will create and execute scripts if I pass in the credentials to a named
instance of SQL Server. I have 4 properties defined: SQLUSERNAME,
SQLPASSWORD, SQLSERVER, &  SQLINSTANCE. Just to be precise, I have tried the
following:

1) SQL Server Local [unnamed] Instance (Installation WORKS if I pass all 4
properties, uninstallation FAILS). The following all fail
a) UserName, Password, Blank SQLSERVER, Blank SQLINSTANCE
b) UserName, Password, Machine Name as SQLSERVER, Blank SQLINSTANCE
c) Blank UserName, Blank Password, Machine Name as SQLSERVER, Blank
SQLINSTANCE
d) Everything Blank

2) SQL Server named Instance - Everything works just fine (install as well
as uninstall), assuming the user passes in the correct credentials.

I would like to find out other folks' experiences on this or a possible
workaround. Thanks again!


On 1/14/07, Rob Mensching <[EMAIL PROTECTED]> wrote:

 1.  The Windows Installer does not persist/cache Properties for you.  You
need to do it yourself.  There is much discussion of methods to do just that
in the mailing list archive.



2.  I leave the SqlDatabase/@Instance blank and that connects to the
default instance in my scripts.  Also, SQL seems to recognize "(local)" as
the name of the local SQL machine.  I've never tried "localhost" or ".".



*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *Dhaval Patel
*Sent:* Sunday, January 14, 2007 5:07 PM
*To:* [email protected]
*Subject:* [WiX-users] SQL Instance



I am very satisfied with what I have achieved with WIX over the past few
weeks. Nevertheless, I have been running into road blocks while trying to
execute SQL Server related tasks.

1) Upon uninstalling the product, WIX is ALWAYS unable to drop the
database (and unable to execute the uninstallation script) for some reason.
Installing is never a problem - but because of this anomaly, I have to set
"ContinueOnError" attribute to "yes". Quite frankly I would like to pinpoint
the reason for this behavior. In the attached JPG file, I have a dialog that
pops up during installation which collects user's SQL credentials which are
then passed on to WIX as properties. I was under the impression that WIX
caches this information (correct me if I am wrong here, folks) and will use
it during uninstallation to establish a connection with SQL Server during
the uninstallation phase. Anyway, I thought that this was not a feasible
solution - what if the admin has changed the password: so now I present the
same dialog if the user decides to remove the product (I still have to test
this functionality). I would be more than happy if someone can throw some
light on my assumptions and why WIX is unable to uninstall the database.

2) When my release will be deployed, it may be installed on a machine that
either has a named instance of SQL Server or a default instance of SQL
Server. The 4 textboxes I present to the user work just fine if the machine
has a named instance of SQL Server installed (Here the user MUST type the
machine name, because "localhost" or "." don't seem to work which is not a
big deal). However, the database creation and SqlScript installation phase
fails if the machine has a default instance of SQL Server - for this reason
I must fall back to providing the end user with batch files for the
install/uninstall SQL scripts, which is quite inelegant. I have tried by
passing in the machine name for SQLSERVER, and leaving the SQLINSTANCE box
blank (I don't know what to pass in for the default instance of SQL Server
!?!?). Again, I would appreciate if someone can provide a solution to this
dilemma.

Here are the Sql scripts:

<!-- SQL Components -->
<Component Id ='SqlDatabaseInstall' DiskId='1'
Guid='7FE20B5C-FF37-4618-8D6F-3D04BD66E845'>

<SqlDatabase Id='SqlInstall' ContinueOnError='yes' CreateOnInstall='no'
Database='master'

          CreateOnReinstall='no' DropOnInstall='no'
Instance='[SQLINSTANCE]'

          DropOnReinstall='no' User='MySqlUser' Server='[SQLSERVER]'
DropOnUninstall='no' >

          <SqlScript Id='InstallScript' BinaryKey='CreateSql'
ExecuteOnInstall='yes' User='MySqlUser'

          ContinueOnError='yes' ExecuteOnReinstall='no'
ExecuteOnReInstall='no' ExecuteOnUninstall='no' />

          </SqlDatabase>
</Component>
<Component Id ='SqlDatabaseUninstall' DiskId='1'
Guid='25CF21B9-DC63-4ac1-9E16-D3B73F5302DF'>
          <SqlDatabase Id='SqlUninstall' ContinueOnError='yes'
CreateOnInstall='no' Database='master'

          CreateOnReinstall='no' CreateOnUninstall='no' DropOnInstall='no'
Instance='[SQLINSTANCE]'
          DropOnReinstall='no' User='MySqlUser' Server='[SQLSERVER]'
DropOnUninstall='no' >
          <SqlScript Id='UninstallScript' BinaryKey='RemoveSql'
ExecuteOnInstall='no' User='MySqlUser'

          ExecuteOnReInstall='no' ContinueOnError='yes'
ExecuteOnReinstall='no' ExecuteOnUninstall='yes'  />

          </SqlDatabase>
</Component>

<!-- Path to Sql scripts -->
<Binary Id='CreateSql' SourceFile='Database.sql' />
<Binary Id='RemoveSql' SourceFile=' Drop.sql'/>

Thanks in advance!

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to