/build/static/layout/Breadcrumb_cap_w.png

Why isn't this Active Setup working?

I need to use Active Setup to install something across every profile that logs in on a machine. It's been a while since I've messed around with Active Setup and I now I can't get it to work again. Maybe someone can see my mistake.

Created the following key:

HKLM\SOFTWARE\Microsoft\Active Setup\installed Components\Notepad

VALUE1
StubPath="notepad"

VALUE2
Version=1

Both values are set to REG_SZ. Now when I log in under a different profile, shouldn't it launch notepad?

0 Comments   [ + ] Show comments

Answers (11)

Posted by: dpolishsensation 17 years ago
Blue Belt
0
Hi nheim -

The bonemanblog is actually exactly what I used for this test. Notepad is not under HKCU and not launching on other profiles so I'm not sure what I'm doing wrong [:(]
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi Marek,
you must have overlooked something, then. Go to an other machine and do it again, step by step.
You can't call an MSI file directly. You have to call msiexec.exe with a correct command line.
Regard, Nick
Posted by: dpolishsensation 17 years ago
Blue Belt
0
Well I just tried it again on two different machines and it's not working. I logged under another account and the Active Setup key does not copy over from HKLM to HKCU. This is so frustrating! [:(]
Posted by: MPA2012 17 years ago
Senior Yellow Belt
0
Marek,

Why are you trying to run an MSI for every user, when you can just add the delta to CurrentUser of the MSI and that will install the delta for each profile?
Posted by: dpolishsensation 17 years ago
Blue Belt
0
Because I was told this was the best way to push something out to every profile. [;)] So I need to edit the CurrentUser property in the MSI? Can you give me some more details as to this procedure?
Posted by: KrisBcn 17 years ago
Purple Belt
0
Hi dpolishsensation,
I don't understand what are you trying exactly to do but when I use ActiveSetup I do it this way :

[HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\[ProductCode]]
"StubPath"="msiexec /fup [ProductCode] /qn"


I use it when I have any CurrentUser data (files or regs) that must be copied on each profile, repairing it.
As a best Practice, I create a CurrentUser Feature as a top-level feature, and (when repackaging) move all other features inside this one. This also forces the repairing of this CurrentUser Feature when self-healing for any reason.

Hope it helps

KrisBcn
Posted by: MPA2012 17 years ago
Senior Yellow Belt
0
Here is the doc I followed. I got it from the Altiris Form.

Posted by John_McFadyen_290967
On Tue, 25 Nov 2003 04:11:11

Guys this has been posted here before but it seems the questions are being raised again so I’m goanna repost it.

This is both documents I have written, most of you have only seen the first one.

Current User self healing

Hi all,

I’ve been reading posts in here by various people for months now and decided it was time for me to try and assist others like many have helped me in the past. This is my first attempt at this so go easy on me with the comments.

A particular thanks goes to Paul Teodorescu, Edward Tippelt and Bob Kelly whom are well known in MSI groups and forums.

Over the last months I have been faced with learning how the MSI technology works and have developed a few techniques which may be useful to many of the new comers.

First I will outline a few important items which are critical to building MSI packages.


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:
registry keys
files
ODBC configuration
to name a few. A component has a unique identifier called a {GUID} which is represent by a 16 bit HEX code.

Primary Key: The primary key 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.

I hope this is helpful to some of you. Its pretty hard to put into words so hopefully it will clear up some behaviour and assist with healing HKCU components.

Next time I will address the Current User files.

Please if you have any comments feel free to mail me on huckey@mindless.com



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 folders 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.

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.

This stuff is pretty hard to put into words so if you have any questions please ask, as this may help both you and I.

Note this is not the only way to heal files in user profiles but its a way that I find the cleanest as it requires no outside scripts or configuration.

thx

John McFadyen
huckey@mindless.com
Posted by: Mackan75 17 years ago
Orange Belt
0
Hi.
That should be enought to get the Active Setup to run. I tried it on a XP SP2 machine, and it worked fine.
I have tried it both with and without the ", and it worked here..
Can you have Group Policy that can stop the Active Setup from running?

/M.N
Posted by: dpolishsensation 17 years ago
Blue Belt
0
I don't think we have any Group Policy in place to prevent this. What I'm ultimately trying to do is have an MSI execute and install something on each profile. Would I just need to specify the full path to the MSI in the StubPath field? For example:


HKLM\SOFTWARE\Microsoft\Active Setup\installed Components\Test

VALUE1
StubPath="\\server\test\test.msi"

VALUE2
Version=1


This should in theory launch the MSI on each profile (and for example install a specific shortcut to each profile), correct?
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi Marek,
please go to: HKCU\SOFTWARE\Microsoft\Active Setup\installed Components\ and look for "Notepad". If its there, remove it and logoff/logon.
And Read this:
http://itninja.com/question/how-do-you-roll-out-new-machines?4491
http://bonemanblog.blogspot.com/2004/12/active-setup-registry-keys-and-their.html

Regards, Nick
Posted by: Mackan75 17 years ago
Orange Belt
0
ORIGINAL: dpolishsensation

I don't think we have any Group Policy in place to prevent this. What I'm ultimately trying to do is have an MSI execute and install something on each profile. Would I just need to specify the full path to the MSI in the StubPath field? For example:


HKLM\SOFTWARE\Microsoft\Active Setup\installed Components\Test

VALUE1
StubPath="\\server\test\test.msi"

VALUE2
Version=1


This should in theory launch the MSI on each profile (and for example install a specific shortcut to each profile), correct?




This should in theory launch the MSI on each profile (and for example install a specific shortcut to each profile), correct?


It did a test on that and it didnt work, but it did write the Active Setup in Current User, I looked in eventvwr.exe but there were no info about the MSI-installaion...
If the MSI is installed on the machine you can do a repair of the MSI instead, then you can write "msiexec /fu {package-code}" in the StubPath and the package should only repair Current User Settings. I have done that a couple of times and it works perfectly, dont know how it reacts on shortcuts however.

Good Luck!

/M.N
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