Bugs item #1440141, was opened at 2006-02-28 01:42
Message generated for change (Comment added) made by jasona941
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1440141&group_id=105970
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: extensions
Group: v2.0
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Osmond (mosmond)
Assigned to: Scott Kurtzeborn (scotk)
Summary: ConfirmOverwrite in Create SQL Database not working
Initial Comment:
Using the SQL Database Element.
Appears to be a bug where if you set ConfirmOverwrite
to yes, and the installer prompts that a database
exists, continue yes/no; if I select no, the install
scripts are
executed anyway. I am not actually a developer, but
I took a look at
the CustomAction and I think there is a problem in
scaexec.cpp -
In the function CreateDatabase
if (iAttributes & SCADB_CONFIRM_OVERWRITE)
{
// Check if the database already
exists
hr = SqlDatabaseExists(pwzServer,
pwzInstance, pwzDatabase, fIntegratedAuth, pwzUser,
pwzPassword, &bstrErrorDescription);
MessageExitOnFailure2(hr,
msierrSQLFailedCreateDatabase, "failed to check if
database exists: '%S', error: %S", pwzDatabase, NULL
== bstrErrorDescription ? L"unknown error" :
bstrErrorDescription);
if (S_OK == hr) // found an existing
database, confirm that they don't want to stop before
it gets trampled
{
if (IDNO ==
WcaErrorMessage(msierrSQLDatabaseAlreadyExists, hr,
MB_YESNO, 1,
pwzDatabase))
ExitOnFailure
(hr, "failed to
initialize");
}
}
1. hr holds the result of SqlDatabaseExists - which
is true in the case of this problem.
2. The CA then prompts with a datbase already exists -
and if the answer is IDNO then it calls
ExitOnFailure.
3. But if I read ExitOnFailure(hr, ...) correct, it
only fails if hr is false, but this will still be
true as per 1.
4. Result is the CA continues to process the
CreateDatabase on a response of either yes or no.
Michael
----------------------------------------------------------------------
Comment By: Jason A. (jasona941)
Date: 2006-06-27 08:55
Message:
Logged In: YES
user_id=1546905
I'm using version 2.0.3719.0 and also seeing the same problem.
I noticed that the CreateDatabase function has been fixed so
that the HRESULT passed to ExitOnFailure is a FAILED hr.
Unfortunately, the problem persists -- an existing database
is dropped even if the "NO" button on the ConfirmOverwrite
dialog is clicked by the user.
I went hunting for the sca.wxilib source and found the
sca.wxs file. In it I see a CustomAction setup to execute
the DropDatabase function on rollback. But I don't see any
checks (either in the DropDatabase or the Wix source)
preventing an existing database being dropped. Here's the
relevant lines from the sca Wix source:
<CustomAction Id="ConfigureSql" BinaryKey="ScaSchedule"
DllEntry="ConfigureSql" Execute="immediate" Return="check" />
<CustomAction Id="CreateDatabase" BinaryKey="ScaExecute"
DllEntry="CreateDatabase" Execute="deferred" Return="check" />
<CustomAction Id="RollbackCreateDatabase"
BinaryKey="ScaExecute" DllEntry="DropDatabase"
Execute="rollback" Return="check" />
----------------------------------------------------------------------
Comment By: DGutride (dgutride)
Date: 2006-05-15 09:25
Message:
Logged In: YES
user_id=1204611
I've noticed this same behavior. When the confirm overwrite
prompt shows up, if you say don't overwrite, the scripts
execute anyway and then the database was dropped when I
tested it.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=642714&aid=1440141&group_id=105970
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
WiX-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-devs