My installer needs to work under WinXP and Win2K for this round. I wrote a
custom action and it works great under WinXP but fails under Win2K and I
cannot figure out why. I am using WiX v3.0.2420, both machines have Windows
R Installer. V 3.01.4000.1823 installed.
The custom action is in a C++ DLL, here is the action function:
UINT __stdcall WriteTSBIni(MSIHANDLE hInstaller)
{
UINT rc = ERROR_SUCCESS;
USES_CONVERSION;
// Get the installation directory name
TCHAR *cchWindowsFolder = privMsiGetPropertyStr(hInstaller,
TEXT("WindowsFolder"));
TCHAR *cchInstallDir = privMsiGetPropertyStr(hInstaller,
TEXT("INSTALLDIR"));
TCHAR *cchIviDir = privMsiGetPropertyStr(hInstaller,
TEXT("IVIDIRPROP"));
if (cchIviDir)
{
if (cchWindowsFolder)
{
if (cchInstallDir)
{
size_t szBuf = strlen(W2CA(cchInstallDir)) +
strlen ("Test Script Builder\\TestScriptBuilder.ini") + 1;
char *cchIniName = new char[szBuf];
FILE *fIni;
if (errno_t err = fopen_s(&fIni, cchIniName, "w"))
{
sprintf_s(cchIniName, szBuf, "err=%d", err);
return ERROR_INSTALL_FAILURE;
}
else
{
fprintf (fIni, "-vmargs\r\n");
fprintf (fIni, "-Djava.lang.path=.;");
fprintf (fIni, "%s.;", W2A(cchIviDir));
fprintf (fIni, "%s.;", W2A(cchWindowsFolder));
fprintf (fIni, "%sSystem32\\.;\r\n",
W2A(cchWindowsFolder));
fclose (fIni);
}
delete[] cchIniName;
delete[] cchInstallDir;
}
delete[] cchWindowsFolder;
}
delete[] cchIviDir
}
return ERROR_SUCCESS;
}
---
The .wxs source snippet is:
<CustomAction Id="CAKE_WRITE_TSB_INI" BinaryKey="CAKE_ACTIONS"
DllEntry="WriteTSBIni" Return="check" />
<InstallExecuteSequence>
<Custom Action="CAKE_WRITE_TSB_INI" After='CreateShortcuts'>NOT
Installed</Custom>
</InstallExecuteSequence>
---
I ran with the /la switch and got the same sequence on both machines, until
after the CAKE_WRITE_TSB_INI action. I checked the sequencing with Orca,
CAKE_WRITE_TSB_INI is in the InstallExecuteSequence table at #4501, right
after CreateShortcuts as expected. The fopen_s error that I get under Win2K
indicates the folder doesn't exist (2). I used message boxes to pause the
custom action and checked, and despite being past that point in the log file
and sequence, the directory indeed was non-existent.
I have no idea what to try next or why this is behaving differently. Help?
Julie Campbell
[EMAIL PROTECTED]
_____________________________________________________________________________
Scanned by IBM Email Security Management Services powered by MessageLabs. For
more information please visit http://www.ers.ibm.com
_____________________________________________________________________________
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users