views:

373

answers:

1

Hey folks,

i created a web setup project in vs 2008 and added some custom actions. While installing i get the default forms (apppool, appname, website), some pre-defined custom forms and some selfmade custom forms. Now while installation i add some data in the registry.

I have only one problem: TARGETSITE property. This property is filled by default form (Context.Parameters["TargetSite"] is something like "/LM/W3SVC/1" for defaultWebSite) and its value properly added to the registry. Everthing is fine until i use the repair function...

Whilst repairing, the first few default forms will be skipped by installation, therefore the TARGETSITE property will be empty (Context.Parameters["Targetsite"] is ""). Sadly i can not interfere with that to get the needed value from registry where i added it for exactly that reason. Because the registry values will be updated before custom code is triggered in the "override Install" method. Even onBeforeInstall is fired after the registry has been updated.

If a rollback is done, while repairing, the registry key will be reset to the correct value before, so i have to believe, that somehow i can access this value from within my custom action code.

Someone has any suggestion on how to get this important value?

P.S.: i tried to set the condition within the registrykey, so that it would only be updated when the TARGETSITE value is not empty, but i´m afraid this will be ignored big time... TARGETSITE != "" in the registry keys condition-field has absolutely no efect whatsoever...

A: 

I solved the problem by working around the installers registry key. I manually create a subKey under the installers registryEntry, where I store my Context.Parameters["TARGETSITE"] value. So the repair feature will not overwrite the keyValue because it´s a custom key. Now I have my value either in the context or in the registry.

FunFacts: When I create the customKey within the Installers own key, I take advantage of the standart meachnism, which delets the installers registry key and with that my customKey will also vanish.

Maybe this might help if someone else faces this problem sometime...

Dennis