Why don't you guys just look at the authoring and CustomAction code for this in
WiX v3? It should be trivial to port that to WiX v2 syntax and build it
yourself... Bob's already done the testing and would probably save you a lot
of trouble.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wilson, Phil
Sent: Friday, January 05, 2007 09:52
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Custom Action DLL
That code doesn't check the value returned by ShellExecute - for all you know
it's returning ERROR_FILE_NOT_FOUND. I'd also put a diagnostic messagebox call
to show szFullPath, just to make sure it's what its supposed to be.
Phil Wilson
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Levi Wilson
Sent: Friday, January 05, 2007 7:06 AM
To: Lionel Pinkhard; wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Custom Action DLL
Can I see how you have your .wxs file setup to call this?
On 1/5/07, Lionel Pinkhard <[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> > wrote:
#include "Install.h"
TCHAR *GetPath(MSIHANDLE hInstall, TCHAR *szFolder)
{
TCHAR* szPath = NULL;
DWORD cchPath = 0;
UINT uiStat = MsiGetProperty(hInstall, szFolder, TEXT(""), &cchPath);
if (uiStat == ERROR_MORE_DATA)
{
++cchPath;
szPath = new TCHAR[cchPath];
if (szPath)
{
uiStat = MsiGetProperty(hInstall, szFolder, szPath, &cchPath);
}
}
if (uiStat != ERROR_SUCCESS)
{
if (szPath != NULL)
delete [] szPath;
return NULL;
}
return szPath;
}
UINT ExecFile(MSIHANDLE hInstall, TCHAR* szFile)
{
TCHAR* szFullPath = new TCHAR[256];
TCHAR* szInstallDir;
szInstallDir = GetPath(hInstall, TEXT("INSTALLDIR"));
if (szInstallDir == NULL)
return ERROR_INSTALL_FAILURE;
swprintf_s(szFullPath, 256, TEXT("%s%s"), szInstallDir, szFile);
ShellExecute(GetForegroundWindow(), TEXT("open"), szFullPath, NULL, NULL,
SW_SHOWNORMAL);
delete [] szInstallDir;
return ERROR_SUCCESS;
}
extern "C" __declspec(dllexport) UINT __stdcall FFRemove(__in MSIHANDLE
hInstall)
{
return ERROR_SUCCESS;
}
extern "C" __declspec(dllexport) UINT __stdcall SBInstall(__in MSIHANDLE
hInstall)
{
return ExecFile(hInstall, TEXT("PimpFishRSS.gadget"));
}
extern "C" __declspec(dllexport) UINT __stdcall SBRemove(__in MSIHANDLE
hInstall)
{
return ERROR_SUCCESS;
}
extern "C" __declspec(dllexport) UINT __stdcall PostInstall(__in MSIHANDLE
hInstall)
{
return ExecFile(hInstall, TEXT("walkthrough.URL"));
}
extern "C" BOOL WINAPI DllMain(
IN HINSTANCE hInst,
IN ULONG ulReason,
IN LPVOID)
{
switch(ulReason)
{
case DLL_PROCESS_ATTACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
----- Original Message -----
From: Levi Wilson<mailto:[EMAIL PROTECTED]>
To: wix-users@lists.sourceforge.net<mailto:wix-users@lists.sourceforge.net> ;
[EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>
Sent: Thursday, January 04, 2007 3:28 PM
Subject: Re: [WiX-users] Custom Action DLL
I believe that if it is a deferred CA you will have limited access to the MSI
database (The "CustomActionData" property only pretty much). Are you checking
the return value from the MsiGetProperty? Maybe post your C++ code so we can
take a look at it, but first of all, can you also throw in a MessageBox() call
to see if your CA is getting called (if you haven't already done that).
- Levi
Lionel Pinkhard wrote:
Hi,
I'm trying to write a custom action DLL that looks up an MSI variable and then
shellexecutes it, this is turning out to be extremely difficult, as if I call
ShellExecute in Win32 API (using C++), it just does nothing, everything in the
code appears to be working, but it just does nothing, is there any secret here?
Regards,
Lionel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users