Self Healing HKCU key which already exists
Hi,
I created an MSI package that sets a HCKU regkey to point to a path like "o:\"
By default the key already exist prior to the installation of the package, but with an incorrect value.
Result is, the package (regkey required) does not self heal because the regkey already exists. only the value is wrong.
When I first manually delete the regkey from the users profile and then start the app. It does self heal and sets the key to "o:\"
Can anyone help me to find the solution for this?
I use ScriptLogic MSI studio to create my packages.
Thanks.
I created an MSI package that sets a HCKU regkey to point to a path like "o:\"
By default the key already exist prior to the installation of the package, but with an incorrect value.
Result is, the package (regkey required) does not self heal because the regkey already exists. only the value is wrong.
When I first manually delete the regkey from the users profile and then start the app. It does self heal and sets the key to "o:\"
Can anyone help me to find the solution for this?
I use ScriptLogic MSI studio to create my packages.
Thanks.
0 Comments
[ + ] Show comments
Answers (8)
Please log in to answer
Posted by:
nheim
16 years ago
Hi Marcel,
use an Active Setup entry.
Add 3 lines like this to the Registry table:
RegHKLM1 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] Stubpath msiexec /i [ProductCode] /fu /qn MainComponent
RegHKLM2 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] Version 1,0,0 MainComponent
RegHKLM3 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] [ProductName] User Setup MainComponent
replace MainComponent with one of the components of the main feature.
Regards, Nick
use an Active Setup entry.
Add 3 lines like this to the Registry table:
RegHKLM1 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] Stubpath msiexec /i [ProductCode] /fu /qn MainComponent
RegHKLM2 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] Version 1,0,0 MainComponent
RegHKLM3 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] [ProductName] User Setup MainComponent
replace MainComponent with one of the components of the main feature.
Regards, Nick
Posted by:
Marz28
16 years ago
ProductCode]
Hi nheim,
thanks for your reply. THis seems a very good solution.[:)]
Still to understand ok. I would like to ask some more info.
The first line does not work for me. When I run from commandline I get the MSI.exe info screen with options.
When I use : msiexec /fu {productcode} /qn
It works. The registrykey in HKCU is modified to what I need.
Could you please explain what the other 2 lines do?
/fu repairs user specific stuff.
/qn = quiet.
Line 2 : Version, I'm not sure what that is for.
Line 3 : What is that for?
I believe the idea is that when a user logs on, the stubpath command is executed? Is that correct?
Thanks a lot!
Marcel
Posted by:
nheim
16 years ago
Hi Marcel,
sorry the first line is wrong. It should read:
RegHKLM1 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] Stubpath msiexec /fu [ProductCode] /qn MainComponent
The columns look like this:
RegHKLM1
2
SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode]
Stubpath
msiexec /fu [ProductCode] /qn
MainComponent
Line 2 writes the version info. If you have to upgrade the HKCU info, you put in a higher version here and the stuff gets updated.
Line 3 populates the message box, which is displayed the first time the user logs in after deployment. You have seen this before eg. with IE 6 or 7, MediaPlayer etc.
Yes, the stubpath will be executed once.
Regards, Nick
sorry the first line is wrong. It should read:
RegHKLM1 2 SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode] Stubpath msiexec /fu [ProductCode] /qn MainComponent
The columns look like this:
RegHKLM1
2
SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode]
Stubpath
msiexec /fu [ProductCode] /qn
MainComponent
Line 2 writes the version info. If you have to upgrade the HKCU info, you put in a higher version here and the stuff gets updated.
Line 3 populates the message box, which is displayed the first time the user logs in after deployment. You have seen this before eg. with IE 6 or 7, MediaPlayer etc.
Yes, the stubpath will be executed once.
Regards, Nick
Posted by:
AngelD
16 years ago
Nick,
Just a thought but wouldn't it be easier/better to add a dummy registry entry in its own component and to the same component add a RemoveRegistry entry to remove the existing registry entry as we're only talking about one single registry entry to be changed?
It would of course be vital to make sure that this component is triggered for a repair from one of the entry points.
hmm don't know if the above approach is clear enuf [;)]
Just a thought but wouldn't it be easier/better to add a dummy registry entry in its own component and to the same component add a RemoveRegistry entry to remove the existing registry entry as we're only talking about one single registry entry to be changed?
It would of course be vital to make sure that this component is triggered for a repair from one of the entry points.
hmm don't know if the above approach is clear enuf [;)]
Posted by:
nheim
16 years ago
Posted by:
Marz28
16 years ago
Please tell me if I understand correctly:
So first I let my msi create a dummy key:[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Jet\4.0\Engines]
"SystemDB"="DummyValue"
And then in the same component I create a key that removes this dummykey.
Then an other (correct) key to which I trigger selfhealing with the keypath for the registrykey I need?
I think i'm missing something here.....
Thanks
So first I let my msi create a dummy key:[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Jet\4.0\Engines]
"SystemDB"="DummyValue"
And then in the same component I create a key that removes this dummykey.
Then an other (correct) key to which I trigger selfhealing with the keypath for the registrykey I need?
I think i'm missing something here.....
Thanks
Posted by:
AngelD
16 years ago
Hi Marcel,
Creating a dummy entry means not a dummy value. Values are never evaluated for installation only exist or not exist of registry entries are.
So the dummy entry should look like:
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Jet\4.0\Engines]
"MyDummyEntry"="Any value you like"
I would replace the registry key to a more appropriate one ex. HKCU\Software\[ProductName]\Custom
Replace MyDummyEntry with the GUID of the component instead (value from the ComponentId column in the Component table for your component).
So if the SystemDB is the registry value you want to replace then take that registry entry and put it into the component you have created holding the dummy entry.
Creating a dummy entry means not a dummy value. Values are never evaluated for installation only exist or not exist of registry entries are.
So the dummy entry should look like:
[HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Access\Jet\4.0\Engines]
"MyDummyEntry"="Any value you like"
I would replace the registry key to a more appropriate one ex. HKCU\Software\[ProductName]\Custom
Replace MyDummyEntry with the GUID of the component instead (value from the ComponentId column in the Component table for your component).
So if the SystemDB is the registry value you want to replace then take that registry entry and put it into the component you have created holding the dummy entry.
Posted by:
jmcfadyen
16 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.