How to read value of property at uninstallation? - installshield

I have created one basic MSI project in InstallShield. I want to achieve one scenario. For this I'm setting one property at the time of installation using installScript function MsiSetProperty(). But I want also read the value of same property at the time of uninstallation. I need the value of property at uninstallation, which is set at the time of installation.
So is there any way to retrieve the value of property at uninstallation, which is set at the time of installation?

Reading a property at uninstallation is the same as reading it during installation: you call MsiGetProperty(), and if it's in a deferred context you have to pass it through the CustomActionData property. Note as well that setting a property during a deferred context doesn't do much.
However what's probably tripping you up is that properties, in general, are not preserved across Windows Installer sessions. There are exceptions, such as DirProperties for installed components, that are automatically preserved. But most properties are simply forgotten when the current action ends. The typical recommendation is to follow the 'remember property pattern' which, in a nutshell, consists of saving the value of the property to a registry key, and reading it back with a system search.

I just tried a workaround for this. I'm setting registry value at the time of installation & reading that property at uninstallation and setting a value of it to property.

Related

IBM Maximo - empty Reported Date required field on the Service Request application

When I create a new record on the Service Request (SR) application (Maximo 7.6), I would like to set the required Reported Date (SR.REPORTDATE) field blank. Before save action, the user will input data into that field. I wonder how this could be done?
Thanks for the help.
If you look in Database Configuration to see if REPORTDATE has a Default Value, I think you'll find &SYSDATE& in there. If I'm right, then you can delete that default value, save your changes, and apply your changes. Otherwise, you'll need to do as #Dex suggested.
My mind immediately goes to an automation script. A default value control or the default value setting in Database Configuration may work too and is recommended before a script if you have the expertise to confirm or deny this theory.
As for the automation script, I think you can create one with an object launch point on SR on the "add" event. The script would simply set that field to null, which shouldn't change the "required" flag either, so the rest of your needs will still be met.
mbo.setValueNull("REPORTDATE");

Edit selected custom object properties at run time

I have a requirement in which i should read all the property of the class and display them in UI and the user should be able to edit them and again save the edited property values to the same object. The custom object may have one or more custom type with in it. So i need to allow the user to edit those object properties referred in the parent object too. Suggest an approach to do the above requirement.
Thanks in advance.
You can use the same control that Visual Studio uses for it's UI editor: the ProperyGrid.
It does exactly what you want, see Getting the Most Out of the .NET Framework PropertyGrid Control

What's the difference between NSLocale currentLocale vs autoupdatingCurrentLocale?

What's the difference between NSLocale currentLocale vs autoupdatingCurrentLocale? It's not obvious from reading the documentation.
When the user changes their system locale settings, the autoupdating one automatically updates to the new locale.
The currentLocale only retrieve an locale object one time from the current user's settings. autoupdatingCurrentLocale updates the locale object on the fly so you don't need to validate. You might think autoupdateingCurrentLocale is the prefer way, it is per Apple documentation; however, since the returned object may be cached, you don't really need to hold on to it indefinitely when using currentLocale, verse autoupdateingCurrentLocale.
If you are using autoupdatingCurrentLocale, note that this API do not cache the locale object, so you will need a way to compute cache upon receipt. One way is to use notification such as NSCurrentLocaleDidChangeNotification method call.

have set the required property via formula but now there is no option to have a message

I have set the required property to #IsDocBeingSaved but then there is no option to enter s validation message. How do you make a control required under specific conditions and still have a message when it is required
You need to edit the source. Or: check it as required, enter the message, then switch to the computation. The message doesn't get deleted
Actually what I ended up doing is creating a under the validators properties I created a validateRequired and added code to the loaded and disableValidators to make it only active during saving. Works well, just not real obvious. I have used some validators before but not often. Need to keep remembering to go there.

set environment variable by condition in installshield

In my project, I use installshield to insert an environment variable during installation.
PEAK_LIMIT = 1000
However, if I change the value to say - 1500, then during re-installation with higher versions causes the value to be reset to 1000. Is there a way to preserve the current value 1500 instead of resetting?
Thanks
It sounds like you have a hard coded value in your Environment table. Substitute it out with a property that equals that value. Then use a custom action during the install to assign the current value to the property if it has a value. This way when MSI rewrites the environment variable it'll keep the value it read.
Another approach would be to create a second environment variable (PEAK_LIMIT_OVERRIDE) that has higher priority in your application. This way the installer can set the default value to what it thinks is correct and keep that apart from user controlled data.

Resources