It's a deferred-execution DLL custom action that I'm writing. Is it that
I'm doing it too early, too late, the wrong thing, what? (It has to be
after InstallFiles because it modifies 40 of the 8000 files that were
just installed to refer to the location that the files were installed
to, instead of the location that they were built in.)

Here's how the custom action is defined in my main file:

        <CustomAction Id="CA_FileList" Property="CustomActionData"
                                  
Value="MSI;[INSTALLDIR];[#F_txt_Mzc3MjQyNTQ1OA]"
                                  Return="check" />
        <CustomAction Id="CA_Relocate" BinaryKey="B_ClearFolder"
        DllEntry="Relocate" Return="check" Execute="deferred" />

....

        <InstallExecuteSequence>
                <!-- Other custom actions here. -->
                <Custom Action="CA_FileList" After="InstallFiles"/>     
                <Custom Action="CA_Relocate" After="CA_FileList">
                        <![CDATA[NOT (NO_RELOCATE OR Installed)]]>
                </Custom>
        </InstallExecuteSequence>

...


And here's the source code.

UINT __stdcall Relocate(
        MSIHANDLE hModule) // Handle of MSI being installed. [in]
                           // Passed to most other routines.
{
        TCHAR sInstallDirectory[MAX_PATH + 1];
        TCHAR sRelocationFile[MAX_PATH + 1];
        TCHAR sCAData[MAX_PATH * 2 + 7];
        UINT uiAnswer;
        DWORD dwPropLength;

        // Get directory to relocate to.
        dwPropLength = MAX_PATH * 2 + 6; 
        uiAnswer = ::MsiGetProperty(hModule, TEXT("CustomActionData"),
        sCAData, &dwPropLength); 
        if (ERROR_SUCCESS != uiAnswer) {
                return uiAnswer;
        }

// *** At this point, uiAnswer = ERROR_SUCCESS, dwPropLength is 0, and
sCAData is an empty string, ***
// *** so the first tokenize call is failing my check and returning
ERROR_INSTALL_FAILURE. ***
// *** Am I doing something wrong here? ***

        TCHAR *sTokenContext = NULL;
        TCHAR *sToken = NULL;

        sToken = _tcstok_s(sCAData, _T(";"), &sTokenContext);
        if (0 != _tcscmp(sToken, _T("MSI"))) {
                return ERROR_INSTALL_FAILURE;
        }
        sToken = _tcstok_s(NULL, _T(";"), &sTokenContext);
        _tcscpy_s(sInstallDirectory, _MAX_PATH, sToken);
        sToken = _tcstok_s(NULL, _T(";"), &sTokenContext);
        _tcscpy_s(sRelocationFile, _MAX_PATH, sToken);

        return Relocate_Worker(hModule, sInstallDirectory,
        sRelocationFile); // which will return ERROR_SUCCESS or
        ERROR_INSTALL_FAILURE as appropriate.

}

And the applicable log entries from a /l:*vx log (the long gap was
because I was doing some other stuff waiting for the debug stuff to pop
up):

#line 16957
Action ended 18:49:01: InstallFiles. Return value 1.
MSI (s) (08:34) [18:49:01:829]: Doing action: CA_FileList
Action 18:49:01: CA_FileList. 
Action start 18:49:01: CA_FileList.
MSI (s) (08:34) [18:49:01:829]: PROPERTY CHANGE: Adding CustomActionData
property. Its value is
'MSI;C:\vanilla2\;C:\vanilla2\strawberry-ui.reloc.txt'.
Action ended 18:49:01: CA_FileList. Return value 1.
MSI (s) (08:34) [18:49:01:829]: Doing action: CA_Relocate
Action 18:49:01: CA_Relocate. Relocating Strawberry Perl...
Action start 18:49:01: CA_Relocate.
1: Relocating Strawberry Perl... 
Action ended 18:49:01: CA_Relocate. Return value 1.

#line 70989
MSI (s) (08:34) [18:51:39:847]: Executing op:
ActionStart(Name=CA_Relocate,Description=Relocating Strawberry Perl...,)
Action 18:51:39: CA_Relocate. Relocating Strawberry Perl...
MSI (s) (08:34) [18:51:39:857]: Executing op:
CustomActionSchedule(Action=CA_Relocate,ActionType=66561,Source=BinaryData,Target=Relocate,)
MSI (s) (08:34) [18:51:39:857]: Creating MSIHANDLE (2) of type 790536
for thread 2356
MSI (s) (08:D8) [18:51:39:857]: Invoking remote custom action. DLL:
C:\WINDOWS\Installer\MSI495.tmp, Entrypoint: Relocate
MSI (s) (08:E0) [18:51:39:867]: Generating random cookie.
MSI (s) (08:E0) [18:51:39:877]: Created Custom Action Server with PID
2136 (0x858).
MSI (s) (08:40) [18:51:39:917]: Running as a service.
MSI (s) (08:40) [18:51:39:917]: Hello, I'm your 32bit Impersonated
custom action server.
MSI (s) (08:D8) [19:06:01:285]: Closing MSIHANDLE (2) of type 790536 for
thread 2356
Action ended 19:06:01: InstallFinalize. Return value 3.

Hope this helps.

--Curtis Jewell




--
Curtis Jewell
swords...@csjewell.fastmail.us

%DCL-E-MEM-BAD, bad memory
-VMS-F-PDGERS, pudding between the ears

[I use PC-Alpine, which deliberately does not display colors and pictures in 
HTML mail]


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to