When I started writing my CAs I studied the wix source, particularly the CAs
that are part of the wix extensions, like the GamingExtension.  Download the
wix source code zip, and look at the code at
"wix3\src\ext\GamingExtension\ca" (and in the other "wix3\src\ext"
projects).

Those .Net objects/methods are not available in native code. But wix
provides a nice string library which has done everything I have needed so
far.  Incomplete pseudo code to get that property would be something like:

UINT CaFoo( MSIHANDLE hInstalll) {
    HRESULT hr = S_OK;
    UINT er = ERROR_SUCCESS;
...
    LPWSTR pwzIpAddress = NULL;
    
    hr = WcaInitialize(hInstall, L"CaFoo");
    ExitOnFailure(hr, "Failed to initialize");
    WcaLog(LOGMSG_STANDARD, "Initialized.");

    hr = WcaGetFormattedString(L"[IPADDRESS]", &pwzIpAddress);
    ExitOnFailure(hr, "failed to resolve [IPADDRESS]");
    WcaLog(LOGMSG_VERBOSE, "IPADDRESS string is %ls.", pwzIpAddress);

    if (pwzIpAddress && *pwzIpAddress)
    {
        // not NULL or empty
    }

    
LExit:
    // Resource freeing here!
    ReleaseNullStr(pwzIpAddress);

    er = SUCCEEDED(hr) ? ERROR_SUCCESS : ERROR_INSTALL_FAILURE;
    return WcaFinalize(er);
}

Obviously more to it than this, but I hoe this helps.  I use notepad++ to do
a lot of searches of the wix source for examples of how I might approach a
particular issue.  



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Custom-action-without-having-to-install-net-tp7599268p7599284.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to