/build/static/layout/Breadcrumb_cap_w.png

Self heal for Install Shield MSI

Hi All ,
I am facing a strange problem with an application called EPIC DMT.The application is an installshield msi which gets launched with setup.exe. I have made the transform for the msi and poked the property ISSETUPDRIVEN=1. I have to make some customizations in the user for which i have to enter some registry settings. The problem is the msi when installed with transform is not able to self heal ( the shorcuts are advertized). I also tried to include Active setup but it failed. I checked in Event Viewer and it says " Product: EPIC® Diagnostic Maintenance Terminal -- Configuration failed. " Please help . Should i try making a new component for the registry settings in the mst . Thanks in advance

0 Comments   [ + ] Show comments

Answers (11)

Posted by: jmcfadyen 17 years ago
5th Degree Black Belt
13
Features: A feature is a container which may hold other features and components.

Component: A component is a container designed to hold application related information such as:
regsitry keys
files
ODBC configuration
to name a few. A component has a unique identifier called a {GUID} which is represent by a 32 bit HEX code.

Keypath: The keypath is an item in a component which is checked during advertised actuation.

Entry Points: Items within the package can be advertised. It is common to use shortcuts and file extensions as advertised entry points. An advertised entry point will trigger the checking of primary keys for components within a feature.


I will outline a little more exactly how healing works which will assist in understanding why to use the following feature / component structure.

For the following assume there is only one Feature called "COMPLETE" and a few components such as "COMPONENT1" "COMPONENT2" and "COMPONENT3"

COMPONENT1 contains 1 file "FILE1.TXT" with a primary key of "FILE1.TXT"

COMPONENT2 contains 1 file "FILE2.TXT" with a primary key of "FILE2.TXT"

COMPONENT3 contains 1 advertised shortcut "SHORTCUT1"
contains 1 file "FILE3.TXT with a primary key of "FILE3.TXT"
contains 1 file "FILE4.TXT

COMPONENT4 contains 1 HKCU reg key with a primary key of "HKCU\test"

When an entry point such as a shortcut is triggered in an MSI the following will occur. The msi self healing operation will begin its checking process in the following manner. The MSI will enumerate what feature the entry point or in this case the shortcut belongs to. For the above example assume a user runs SHORTCUT1 which is the advertised entry point. This action will cause the MSI to find out what FEATURE SHORTCUT1 is in. The next step is to find out what other components are in this feature. In this case COMPONENT1 COMPONENT2 and COMPONENT3

Each of the COMPONENTS in the same feature as the entry point will be checked. The primary key of each component will then be checked against the workstation to ensure that these primary keys exist.

In this case COMPONENT1 has a primary key of FILE1.TXT therefore the msi will check if FILE1.TXT exists on the workstation and continue this process through all of the COMPONENTS within the same FEATURE the entry point is in. If any of the PRIMARY KEYS are missing the entire feature is healed. As depicted above if FILE4.TXT is missing nothing will happen. FILE4.TXT is not a primary key therefore the MSI will not care if it does not exist.

Now a very important thing to note here is if there are any parent FEATURES windows installer will then step into the parent FEATURE and being this process again and continue until all parent FEATURES are checked.

Now for the interesting part.

Anyone whom has been packaging for a while will know that HKCU registry keys are often the cause of trouble within a package. The current user keys normally are only delivered the user whom is logged in at the time of installation. The msi technology has attempted to overcome this shortcoming and uses self healing to configure current user settings for all users of a given workstation.

When using Wise Package Studio the default actions within Wise will create a COMPONENT called "CurrentUser" this component will have all of the HKCU registry keys inside it. If your using other applications such as InstallShield I expect you could achieve the same results relatively easily.

Now assuming we followed default configuration of Wise all of our components would go into the "COMPLETE" FEATURE including the aforementioned "CurrentUser" COMPONENT.

If you were to use this default methodology any new users logging into a machine and running an advertised entry point would trigger the healing mechanism's checking routines. This would eventually get to the "CurrentUser" COMPONENT and would find that the primary key for the "CurrentUser" COMPONENT would not exist. This in turn would trigger a heal of the entire COMPLETE FEATURE. Now on a small application this may be acceptable however if you have a 600mb application reinstalling the entire application for a new user would probably be extremely excessive.

So to counter this effect with the help of some of the mentioned persons this idea was developed.

Create a new FEATURE STRUCTURE as follows:


FEATURE

"CurrentUser"

Move your "Complete" FEATURE to a child of the "CurrentUser" FEATURE. so you will have the following.

CurrentUser

------------Complete

Whenever you have an application which contains HKCU components put the HKCU components into a COMPONENT called "CurrentUser" and put that COMPONENT into your "CurrentUser" FEATURE.

The remainderof the application would go into your COMPLETE FEATURE as pictured below.


Feature:CurrentUser

Component: CurrentUser

--------Feature:Complete

-------- Component: Component1
-------- Component: Component2
-------- Component: Component3

Now in this scenario if you run the SHORTCUT1 as per the previous example the COMPLETE FEATURE is checked as per normal windows installer operation. In a good package this will not result in healing of the COMPLETE FEATURE as it should already be delivered during install time.

But what is good about this is that once the COMPLETE feature is finished its checking routine Windows Installer behaviour steps up to the parent FEATURE in this case "CurrentUser" and checks that feature also.

If a new user is logged in the primary key for the "CurrentUser" COMPONENT will not exist which will trigger healing on the "CurrentUser" FEATURE therefore effectively you are now only healing a tiny portion of your package not the entire application.


Current User Healing II

If you have not already read my first post this probably wont make alot of sense. Therefore I would recommend reading Current User healing before continuing with this. This assumes you know how healing works and understand fully keypaths and components etc.

For those of you whom have read my first post on HKCU registry healing. Here is the next step which will enable you to heal files as well as HKCU keys.

If you have followed the first step which creates a feature structure in the following manner.

HKCU - (Current User Feature)

- Complete (Remainder of application)


Your HKCU feature will only contain CurrentUser components or components which contain registry entries which are destined for the HKCU registry hive.

The complete feature will contain the main application including all "program files\%appname%" and HKLM entries. The reason for this is explained in the first Current User healing guide.

Now to make full advantage of this method of healing often you are required to put files into the users profile directories such as "c:\documents and settings\%username%\application data" or similar folders such as "my documents" etc.

This is a way to allow you to heal this folder for each user, without requiring to step outside of the msi to maintain the healing process. Therefore no need for active setup or other methods, this is all fully self contained within the msi.

To understand how this works its important to know how the duplicate file table works within the msi. The duplicate file table is used to reduce the size of an msi and increase performance by not replicating files inside the msi. For example if you have a file in your package in the following locations which is identical the default behavious of msi is to not add this file again.

i.e.

c:\program files\%appname%\folder1\file1.txt
c:\program files\%appname%\folder2\file1.txt

here we have 2 files with the same name and structure. Under normal conditions the msi would recognise this file is the same and it would make an entry in the duplicate file table. If we assume in the above example .\folder1\file1.txt was the first file to be placed into this msi it would then show in the file table as a normal file as expected. However when we add .\folder2\file1.txt what you would expect is that another entry would be added to the file table as per the previous entry. However if the msi recognises the file is identical it does not use another entry in the file table instead it creates an entry in the duplicate file table. The duplicate file table then makes a pointer back to the first location where this file was installed to.

Therefore .\folder1\file1.txt was the first entry so instead of .\folder2\file1.txt being added again it uses the duplicate file table and makes a reference back to the install directory of the first file1.txt. In this case "c:\program files\folder1\file1.txt". What this means is that .\folder2\file1.txt does not get installed from the cabs of the msi but installed directly from its first install directory.

In other words the .\folder1\file1.txt is copied to .\folder2\file1.txt.

Hopefully that hasn't confused you too much :-).

The next step is to do this.

As with the first guide I wrote you create your feature structure with the HKCU feature at the top of the tree. You then do this.

HKCU - (CurrentUser components)
-
- Complete Feature (remainder of app)


We now create a folder under [INSTALLDIR] or "C:\program files\%appname%\_user" or whatever naming convention you like. I like "_user". We then add any files into this folder that we would like to be delivered to the users profile. For example if you want "C:\documents and settings\%username%\application data\file1.txt" then we would create the following.

"c:\program files\%appname%\_user\application data\file1.txt" and so on.

For each file that you want to be healed by this method you need to have the same file delivered to "C:\program files\%appname%\_user"

Once you have completed this you then add those same files again into the normal locations of "c:\documents and settings\%username%" however this time the duplicate file table comes into play!!!. These files that are being added for the 2nd time are recognised as already being in the package and the follow the same rules as above with the duplicate file table. Therefore they have entries in the duplicate file table instead of the file table. This also means that these files are healed from the local machine and not from the MSI.

This has a few benefits, one is that you do not require the MSI to be present during healing time. So if you haven't got a connected source it gets around that issue (mind you I am not saying don't use [SourceList]) Its just a workaround if needed.

Now the final touch is to move all the components that were created during this step into the HKCU feature, my preference is to put the files in the same component as the HKCU registry entries that were created via the first guide. This is because the duplicate file components do not have keypaths therefore technically dont have a healing reference. Hence putting them in the HKCU component ensures a heal for each new user.

Therefore you would have the following configuration.

HKCU - CurrentUser (component)
- Contains = HKCU registry
- = Duplicate File infomation


- Complete
- All other components

This means that HKCU is at the top of the tree and contains both the CurrentUser components containing the HKCU registry entries. And the duplicate file table entries are in the same component.

The complete feature just contains the main application.

Putting it all together.

When you run the application and a user has not logged on before the HKCU entries are not present. Therefore when advertising is run from the complete feature the Complete feature is checked, all component keypaths are checked if something is missing from the Complete feature it is healed in its entirety. As per normal the MSI will then step up the tree and run the checking functionality as per before. However in this instance as the advertising is downlevel from the HKCU feature the healing process changes slightly and steps into what is classed as Component level healing. Therefore if a keypath is missing only the single component is healed and not the entire feature. This is the reason why I like to put the duplicate file info into the same component as the HKCU registry entries.

If you delete the HKCU entries when advertising is next run it will put back both the HKCU entries and the files as they are in the same component as the HKCU keys.
Posted by: bheers 17 years ago
Second Degree Blue Belt
0
create a new component for the user registry (HKCU) and make a registry key in it a key path.
Posted by: msi_learner 17 years ago
Orange Belt
0
Hi Bheers,

I already tried the same but no use.Strangely if i make the user as Administrator the Active setup works fine.
Posted by: msi_learner 17 years ago
Orange Belt
0
I have tried logging the self heal process(Thru active setup ) i got error 1729.
Posted by: AB 17 years ago
Purple Belt
0
Dude,
If your shorts are advertised then you shouldn't really need Active Setup so back up a few steps and look at what is happening...
You run a shortcut - in Event Viewer you should see what component is causing the self repair
You mention user profile information is required - is this HKCU registry info or files required in the users profile?
Have you validated the MSI in Orca - do you get errors pertaining to user profiles / current user?
Get the highest birds eye view you can and try to break down what and where things are failing
Post your synopsis
I should be sober by the time I get to view your reply :)
Regards,
Al
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi msi_learner,
please read this:
http://itninja.com/question/distribution-message21
http://www.ewall.org/index.php?module=ContentExpress&func=print&ceid=23
This gives you a very good overview on this topic.
Regards, Nick
Posted by: msi_learner 17 years ago
Orange Belt
0
Hi Everyone ,

Thanks for your response. I did the logging and i beleive the Application is not able to self heal (thru shorcuts or thru active setup) because whenever the Application goes for self heal it runs all the custom actions which are there in the msi and some actions probably require Administrative privileges. This is the reason probably the moment i make the user as an Administrator the application runs just fine.

I wanted to know is there a way i can configure a self heal of only a particular feature. Or any command line with which i can repair the specified feature only.

The appplication has only one default feature, Would it help if make a new feature and put all the HKCU entries there and make the default feature as the child feature as Jmcfadyen has mentioned.
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi msi_learner,
please read the above post from John again and again (have never seen anything like that in a MSI-book, thanks John).
With your last statement, you're on the right track!
Regards, Nick
Posted by: msi_learner 17 years ago
Orange Belt
0
run the checking functionality as per before

Hi Nick ,
I have made a new feature and made the default feature its child but still i am not able to self heal the feature. I still get the error Configuration failed whenever i launch the shortcut.
I am getting confused though, the Exe resides in default feature and when i make a shortcut for the default feature and advertize it , what will happen. Will the entire default feature will get healed or only the CurrentUser feature.
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi msi_learner,
do you log the install? If not please do so. In the logfile you can see where that stuff breaks.
Basically, you need to make sure that you don't have components with registry keys assigned to HKLM and HKCU.
Load the MSI in ORCA, go to the registry table and sort it for the components column. Search for the '1' entries in the root column and make sure, that all of them are associated with a component, which is linked to the User Feature (trough the FeatureComponents table).
Another thing: Look at the files and make sure, that all files with no version info have entries in the MsiFileHash table. Otherwise, if one of them is a key file, the installer can't determine if it's there in the right version or not and write it each time the MSI is run.
If you need to populate the hash, you can do it with 'WiFilVer.vbs' from the SDK.
Regards, Nick
Posted by: jmcfadyen 17 years ago
5th Degree Black Belt
0
just for the record I am going to start some MSI training courses in the southern parts of the world.

in my opinion there is nothing of real interest around at present, except Darwin Sanoys courses which are unfortunately only in the northern parts of the world.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ