This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: MSISetProperty isn't working
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 16, 2010
05:14 AM
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:
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]
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]
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 16, 2010
01:06 PM
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.