cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
langhammer
Level 3

MSISetProperty isn't working

Dear all,

I need to ReadOut the Installationpath because I have to unregister some DLL before uninstalling.

So I use this code:
MsiGetProductInfo("{FA989644-1359-42B8-B334-78A7DB33803F}", INSTALLPROPERTY_INSTALLLOCATION, svINSTALLDIR, nBuffer);


Now I will save the value (svINSTALLDIR) in an Property to work with in a custom action.

Can you help in this case ?

[CODE]#include "ifx.h"
export prototype MyFunction(HWND);

function MyFunction(hMSI)
STRING svINSTALLDIR;
STRING svSAMPLE[256];
NUMBER nBuffer2;
INT nBuffer;

// To Do: Declare local variables.
begin
// To Do: Write script that will be executed when MyFunction is called.
nBuffer = 256;
nBuffer2 = 256;


MsiGetProductInfo("{FA989644-1359-42B8-B334-78A7DB33803F}", INSTALLPROPERTY_INSTALLLOCATION, svINSTALLDIR, nBuffer);
MessageBox(svINSTALLDIR,SEVERE);
MsiSetProperty(ISMSI_HANDLE, "OLDINSTALLDIR", svINSTALLDIR);

// For Testing
MsiGetProperty(ISMSI_HANDLE, "OLDINSTALLDIR", svSAMPLE, nBuffer2);
MessageBox("INSTALLDIR = " + svSAMPLE, INFORMATION);
MessageBox("MSI PROP GESETZTE",SEVERE);
end;
[/CODE]
Labels (1)
0 Kudos
(1) Reply
hidenori
Level 17

If you are using a deferred custom action, please check out the Accessing or Setting Windows Installer Properties Through Deferred, Commit, and Rollback Custom Actions help topic.
0 Kudos