self repair of public properties
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?
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
Answers (17)
Please log in to answer
Posted by:
MSIPackager
18 years ago
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.
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.
Posted by:
kingici
18 years ago
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?
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?
Posted by:
MSIPackager
18 years ago
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.
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.
Posted by:
MSIPackager
18 years ago
Posted by:
Ilikebananas
18 years ago
Posted by:
kingici
18 years ago
Posted by:
MSIPackager
18 years ago
Posted by:
MSIram
18 years ago
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,,,
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,,,
Posted by:
MSIram
18 years ago
Posted by:
jayteeo
15 years ago
Posted by:
AngelD
15 years ago
Posted by:
anonymous_9363
15 years ago
Posted by:
jayteeo
15 years ago
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?
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?
Posted by:
AngelD
15 years ago
Posted by:
jayteeo
15 years ago
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.
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.
Posted by:
AngelD
15 years ago
Posted by:
anonymous_9363
15 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.