Harvey Werner wrote:
> I tried the following. It works for the install, but on
> uninstall it removes ProgramArguments from the registry which
> is obviously not what I want. I just want to set it's value
> to null and leave it alone.
>
> <Component Id="bin" ...
> <Registry Id="DLM" Root="HKLM"
> Key="SOFTWARE\<blah>\<blah>\service\Started Processes\dlm"
> Name="ProgramArguments" Type="string" Value=" " Action="write" />
> </Component>
>
> How is this done?
I'd try a custom action:
<Binary Id='ca.dll' SourceFile='ca.dll'/>
<CustomAction Id='WriteKey' BinaryKey='ca.dll' Execute='immediate'
DllEntry='write_key'/>
In the InstallExecuteSequence:
<Custom Action='WriteKey' Before='ProcessComponents'> some condition</Custom>
and in ca.c
#include <windows.h>
#include <tchar.h>
//The SDK is clear: the signature of a custom action should be:
//UINT __stdcall CustomAction( MSIHANDLE hInstall )
//_tcslen strlen strlen wcslen
__declspec(dllexport) int write_helper(wchar_t * key, wchar_t * cmd, int seq)
{
HKEY hk;
DWORD dwDisposition;
RegCreateKeyEx(HKEY_LOCAL_MACHINE, key, 0, L"", 0, KEY_READ | KEY_WRITE,
NULL, &hk, &dwDispos
RegSetValueEx(hk, L"Sequence", 0, REG_DWORD, (LPBYTE)&seq,
(DWORD)sizeof(seq));
RegSetValueEx(hk, L"InstallCommand", 0, REG_SZ, (LPBYTE)cmd,
(DWORD)(wcslen(cmd)+1)*sizeof(w
RegCloseKey(hk);
return 0;
}
__declspec(dllexport) int write_key()
{
return write_helper(
L"Software\\...\\..\\...",
L"your value",
100
);
}
Something like that used to work for me in a similar case.
Might be complete overkill, though...
Andre'
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users