extern "C" UINT __stdcall DropDatabase(MSIHANDLE hInstall)
{

                …
                hr = WcaInitialize(hInstall, "DropDatabase");
                ExitOnFailure(hr, "failed to initialize");

                hr = ::CoInitialize(NULL);
                ExitOnFailure(hr, "failed to intialize COM");

                hr = WcaGetProperty( L"CustomActionData", &pwzData);
                ExitOnFailure(hr, "failed to get CustomActionData");

                WcaLog(LOGMSG_TRACEONLY, "CustomActionData: %S", pwzData);

                pwz = pwzData;
                hr = WcaReadStringFromCaData(&pwz, &pwzDatabaseKey);
                ExitOnFailure(hr, "failed to read database key");
                hr = WcaReadStringFromCaData(&pwz, &pwzServer);
                ExitOnFailure(hr, "failed to read server");
                hr = WcaReadStringFromCaData(&pwz, &pwzInstance);
                ExitOnFailure(hr, "failed to read instance");
                hr = WcaReadStringFromCaData(&pwz, &pwzDatabase);
                ExitOnFailure(hr, "failed to read database");
                hr = WcaReadIntegerFromCaData(&pwz, (int *)&lAttributes);
                ExitOnFailure(hr, "failed to read attributes");
                hr = WcaReadIntegerFromCaData(&pwz, (int
*)&fIntegratedAuth); // Integrated Windows Authentication?
                ExitOnFailure(hr, "failed to read integrated auth flag");
                hr = WcaReadStringFromCaData(&pwz, &pwzUser);
                ExitOnFailure(hr, "failed to read user");
                hr = WcaReadStringFromCaData(&pwz, &pwzPassword);
                ExitOnFailure(hr, "failed to read password");

                hr = SqlDropDatabase(pwzServer, pwzInstance, pwzDatabase,
fIntegratedAuth, pwzUser, pwzPassword, &bstrErrorDescription); //No checks
here


<CustomAction Id="ConfigureSql" BinaryKey="ScaSchedule"
DllEntry="ConfigureSql" Execute="immediate" Return="check" />
<CustomAction Id="CreateDatabase" BinaryKey="ScaExecute"
DllEntry="CreateDatabase" Execute="deferred" Return="check" />

//no checks here too....
<CustomAction Id="RollbackCreateDatabase"
BinaryKey="ScaExecute" DllEntry="DropDatabase"
Execute="rollback" Return="check" />

-- 
View this message in context: 
http://www.nabble.com/Database-is-trying-to-be-dropped-when-it-was-not-created-during-current-install-tf4161278.html#a11929627
Sent from the wix-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to