I have a public property set in my INIFILE table. The value of the property is '0'.
As this value is dependent on certain criteria, at the time of installation sometimes the property needs to be set as '1'.

This is fine until the package self repairs, it always reverts back to the default setting specified within the PROPERTY table, which in this case is '0'.

Is there a way of ensuring that whatever value is specified at the time of installation is then used on any subsequent self repairs, in other words despite the fact that the public property may have a specific value, if you choose to alter that value at install, it will then always use that value an not the value specified in the Property table?
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hi,

It's the component that's writing that entry in the ini file that you want to look at - remove the component keypath and it will disable the self repair. You should be able to create a new component to just deal with that ini file line (the one which uses your public property) then have no keypath for that component. Then the rest of your ini file should still self repair OK.

Let us know how you get on..


Hope it helps,
Rob.
Answered 10/31/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
I created a new component, left the keypath empty and then set the value in the inifile to this component. However, upon self repairing the package reverted back to the public property set within the property table.

I was told sometime ago about a way of storing the value of the property in the registry, and so when a self repair is initiated it then refers back to this entry for it's value, but I don't know how exactly this is implemented.

Any other ideas?
Answered 10/31/2005 by: kingici
Senior Yellow Belt

Please log in to comment
0
Hmm thought that would work to be honest. Presumably you've validated your MSI etc. Not heard of the registry thing I'm afraid.

What if you use the same component to write the whole ini file (forget splitting it) and remove the keypath for that - does it still self repair?

Or, set the Action value on that particular line to 1 (presumably it's currently 0) ? See here for more info...

Cheers,
Rob.
Answered 10/31/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
Guess another option is to set a condition on the WriteIniValues action in the install execute sequence so that it only happens on install e.g. a condition of NOT Installed

Any good?

Cheers,
Rob.
Answered 10/31/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
Hi,

You can also condition the component itself...

Ilikebananas
Answered 10/31/2005 by: Ilikebananas
Purple Belt

Please log in to comment
0
Setting the action on the inifile entry to 1 seems to have resolved the issue. Thanks for all your help and suggestions.
Answered 11/03/2005 by: kingici
Senior Yellow Belt

Please log in to comment
0
Excellent - don't be afraid to rate my post if it helped... I'd could do with getting into double figures [;)]

Cheers,
Rob.
Answered 11/03/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
0
You have to write the public property to the installation cache file using a custom action, so when it self heals it will set the same value as you did during installation.

Dim database:Set database = installer.OpenDatabase(Installer.ProductInfo("[ProductCode]", "LocalPackage"), 1):Dim query, view:query = "UPDATE Property Set Value='[GET]' WHERE Property='GET'":Set view = database.OpenView(query):view.Execute:database.Commit

above is the sample custom action which you need to use...
I can not explain the whole procedure over here. try searching on the web with the above keywords,,,
Answered 11/03/2005 by: MSIram
Senior Yellow Belt

Please log in to comment
0
The above script which was mentioned is in VBscript and you need to call this VB Script through a property.. If you couldn't figure it out mail me at ramesh231@yahoo.com, I will try to put the procedure in a document.

Thanks
MSIRam.
Answered 11/03/2005 by: MSIram
Senior Yellow Belt

Please log in to comment
0
Hate to bump an old thread, but could you explain what you mean by calling VBScript through a property? Do you mean pass the value through a property with the same name as the CA to access CustomActionData?
Answered 02/23/2009 by: jayteeo
Purple Belt

Please log in to comment
0
If the property is set during install-time then the best way would be to write down the property value to registry and read it back on repair.
Ed as a nice little article about this at http://www.etlengineering.com/installer/repair.txt
Answered 02/23/2009 by: AngelD
Red Belt

Please log in to comment
0
could you explain what you mean by calling VBScript through a property?You can store VBS in a property. No script of any worth would fit, though, unless it was incredibly simplistic. Use either embedded code or store it in the Binary table.
Answered 02/23/2009 by: VBScab
Red Belt

Please log in to comment
0
Surely there was a reason he suggested calling it through a property?

AngelD - The property I would actually like to store is a registry value so that route would seem a little redundant. Of course it would work, just doesn't seem as clean.

What I'm trying to accomplish is build logic into the MSI so when the MSI is uninstalled, registry components "restore" their original value if the value was there before the installation. Is there another way to accomplish that?
Answered 02/23/2009 by: jayteeo
Purple Belt

Please log in to comment
0
You could either use a custom action or AppSearch to fetch the current registry to backup and then write it to another location. During uninstall you read it back and (after the RemoveRegistryValues action) you write it back.

What kind of registry value are you looking to restore?
Answered 02/23/2009 by: AngelD
Red Belt

Please log in to comment
0
Hi AngelD,

I agree that would be the easiest way, however, I don't want to bloat the registry with more entries and it would be cleaner if I read it from a property inside the cached database. These are actually Windows settings that are getting updated - some for look and feel, some functionality. When uninstalling, I don't necessarily want to delete the values as they could cause something to blow up.
Answered 02/23/2009 by: jayteeo
Purple Belt

Please log in to comment
0
I'm not sure you can write to the cached msi during install as my guessing would be that it will be locked during this action.
However; there is nothing to stop you from trying, please let us know if it works.
Answered 02/23/2009 by: AngelD
Red Belt

Please log in to comment
0
I agree that would be the easiest way, however, I don't want to bloat the registry with more entries Huh? Just remove the back-up entry when you're done, then (after your CA checks that the value got written, of course!)
Answered 02/24/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity