Your idea makes a great deal more sense than mine.  Adding the property was the easiest way for me to implement the change, but the way you describe is much more logical.  I'll open a bug on this today.

Thanks,
Dana

On 7/10/06, Rob Mensching <[EMAIL PROTECTED]> wrote:

It sounds like a good thing to support somehow.  I'm not sure that looking for a random property, is a good way to go about it.  Can you open a bug on Source Forge to track the issue, so we don't lose it?

 

After that, we have this problem in a few places where pieces of data need to be configurable.  What if we make the SqlDatabase/@User a formatted element?  Then a Property could be used to select the appropriate SqlUser or empty property to mean Windows Auth.  The code doesn't have to change much at all and everything behaves pretty much as it does right now.

 

Would that work well?

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of Dana Gutride
Sent: Monday, July 10, 2006 12:56 PM
To: wix-devs@lists.sourceforge.net
Subject: [WiX-devs] SQLDatabase - integrated authentication vs. sql server authentication

 

Currently, the database custom actions have the option to connect using Integrated Authentication or SQL Server Authentication.  The way the choice is made is determined is based on the presence of a SQLUser tag within the SQLDatabase tag.  

Our UI allows the user to choose between the two, setting a WINDOWS_AUTH property based on the user's choice.  The downside to using the current SQLUser tag methodology as the determining factor is we have to create two components for each database create tag and condition those based on the WINDOWS_AUTH property.  This is fine when you are only referencing a few SQLScripts or SQLStrings.  For complicated databases; however, there can many scripts that need to be executed and it makes it the installation more prone to error and much more complicated by requiring these tags be duplicated.

Would it be possible to include something like the following?  Maybe it would be better to allow the sqluser tag to still remain as the condition, but if the user specifies a WINDOWS_AUTH property, that could be the condition.

I'm including the code I've changed below, any ideas?

Dana

scadb.cpp - starting around line 110

        // if a user was specified
        // need to add get property of Windows_Auth (set in MSI) right here...
        DWORD dwLen = MAX_PATH;
        TCHAR szAuth[MAX_PATH] = {'0'};
    
        if (ERROR_SUCCESS != MsiGetProperty(WcaGetInstallHandle(), _T("WINDOWS_AUTH"), szAuth, &dwLen))
        {
            ExitOnFailure(hr = E_FAIL, "Failed to retrieve windows_auth property");
        }
        
        int iUseAuth = _ttoi(szAuth);
        if (0==iUseAuth)
        {
            psd->fUseIntegratedAuth = FALSE;
            hr = ScaGetUser(pwzData, &psd->scau);
            ExitOnFailure1(hr, "Failed to get user information for database: '%S'", psd->wzKey);
        }
        else
        {
            psd->fUseIntegratedAuth = TRUE;
            // integrated authorization doesn't have a User record
        }


-------------------------------------------------------------------------
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
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to