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
- :
- Accessing Install Location during Uninstall
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
Apr 12, 2010
06:58 PM
Accessing Install Location during Uninstall
Hello,
I was hoping that someone might be able to help me with accessing the application install location during an uninstall operation. From what I have read, the ARPINSTALLLOCATION property is set to the application install location via a custom action. I can see the custom action in the Sequences explorer so I am assuming that the property is being set. To access the property, I have tried using the MsiGetProductInfo method but I always get an empty string:
NUMBER nBufferSize;
NUMBER nResult;
STRING sProductCode[MAX_PATH];
STRING sInstallationDirectory[MAX_PATH];
nBufferSize = MAX_PATH;
nResult = MsiGetProperty(hMSI, "ProductCode", sProductCode, nBufferSize);
nBufferSize = MAX_PATH;
nResult = MsiGetProductInfo(sProductCode, INSTALLPROPERTY_INSTALLLOCATION, sInstallationDirectory, nBufferSize);
I have also tried accessing the property using the MsiGetProperty method but I still get an empty string:
NUMBER nBufferSize;
NUMBER nResult;
STRING sInstallationDirectory[MAX_PATH];
nBufferSize = MAX_PATH;
nResult = MsiGetProperty(hMSI, "ARPINSTALLLOCATION", sProductCode, nBufferSize);
I would appreciate if someone could explain to me what I am doing incorrectly. I am contemplating just accessing the InstallLocation registry value directly but I would like to use the MSI API if possible since it is the proper procedure.
Thanks in advance,
anthonyw
I was hoping that someone might be able to help me with accessing the application install location during an uninstall operation. From what I have read, the ARPINSTALLLOCATION property is set to the application install location via a custom action. I can see the custom action in the Sequences explorer so I am assuming that the property is being set. To access the property, I have tried using the MsiGetProductInfo method but I always get an empty string:
NUMBER nBufferSize;
NUMBER nResult;
STRING sProductCode[MAX_PATH];
STRING sInstallationDirectory[MAX_PATH];
nBufferSize = MAX_PATH;
nResult = MsiGetProperty(hMSI, "ProductCode", sProductCode, nBufferSize);
nBufferSize = MAX_PATH;
nResult = MsiGetProductInfo(sProductCode, INSTALLPROPERTY_INSTALLLOCATION, sInstallationDirectory, nBufferSize);
I have also tried accessing the property using the MsiGetProperty method but I still get an empty string:
NUMBER nBufferSize;
NUMBER nResult;
STRING sInstallationDirectory[MAX_PATH];
nBufferSize = MAX_PATH;
nResult = MsiGetProperty(hMSI, "ARPINSTALLLOCATION", sProductCode, nBufferSize);
I would appreciate if someone could explain to me what I am doing incorrectly. I am contemplating just accessing the InstallLocation registry value directly but I would like to use the MSI API if possible since it is the proper procedure.
Thanks in advance,
anthonyw
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Apr 13, 2010
01:01 PM
Hi,
Just thought that I'd follow up with what I discovered. My mistake was that I was using deferred execution for my custom action. So probably what was happening was that the install location no longer existed in the registry by the time my custom action was being executed. This was corrected by changing the custom action to immediate execution.
anthonyw
Just thought that I'd follow up with what I discovered. My mistake was that I was using deferred execution for my custom action. So probably what was happening was that the install location no longer existed in the registry by the time my custom action was being executed. This was corrected by changing the custom action to immediate execution.
anthonyw