MSI - remove Environment value at install
I have an Environment value than needs to be removed at the install of another piece of software, call it an upgrade.
I have not yet been able to find enough information to successfully remove the required Environment Path
my Environment Table looks like this
Environment : NewEnvironment1
Name : !-*C:\ProgramData\Oracle\Java\javapath
Value : [~]
Component : NewComponent1
Has anybody performed an Environment removal before that was not put there by the installing MSI? What have I got wrong?
Edit: I have also tried with the placement set to Replace (blank Value field)
Edit Edit : I just tried to set a Path Variable
Name : NewCustomPathVariable
Defined Value : C:\ProgramData\Oracle\Java\javapath
Current Value :
Type : Environment
and then used the Name field (Path Variable) in Name field (Environment table) - still didn't work
Answer Chosen by the Author
PfM is the answer. It works!!
I have just made an MSI with the chosen modes required. I logged into a test machine, I modified the PATH to include :
I also added another folder after that, THEN I rebooted, checked the PATH statement, it was 'wrong'.
I then installed my MSI which was set to remove "C:\ProgramData\Oracle\Java\javapath;" from the path statement when installed...
then I rebooted again... (Path statement in the System context)
the MSI had nicely removed exactly the text I wanted.
Here is what the table entries looked like.
Hope it helps
Community Chosen Answer
Any package that came my way for QA would fail if a CA was used instead of an internal mechanism - unless there was a very good reason!
On your first example the value is empty, so nothing will be set.
The basic layout is as follows:
Environment - 'friendly' name for your environment setting
Name - Name of the environment variable being set, with prefixes if required
Value - The path being set in the variable
See this link and this link for further details and examples.
Hope that helps,