Self healing to copy file to appdata folder
I do not have a background in application pakaging so please excuse my ignorance.
I am trying to repackage Cisco Anyconnect VPN Mobilty Client. To pre-populate the server field once the software is installed I need to copy an XML file to the "Appdata\Local\Cisco\Cisco AnyConnect Secure Mobility Client" folder of each user profile.
Now, I believe self-healing is the best way to accomplish this. I have read tutorials and previous posts on self healing but cannot for the life of me get it to work. Can someone please provide or point me to some step by step instructions for me to do this?
Any assistance is very much appreciated.
Thanks in advance.
Answers (1)
To execute actions if a new user logs on, e.g. to write user-specific entries to the registry, Active
Setup can be used.
Therefore the following entries can/have to be made in a MSI package/
transform (.MST file) in registry table:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode]]
"Version"="<application version>
"IsInstalled"=hex:01
"StubPath"="<action to execute> (msiexec /u
"[ProductCode])
"="<application name>" (optional)
You have to be sure that the user files are added in mst file.
For testing you can modify the next reg file and import it to your registry.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductCode]]
@="[ProductName]"
"IsInstalled"=dword:00000001
"StubPath"="\"msiexec.exe /u [ProductCode]\""
"Version"="[ProductVersion]"
1. Add the user data file to your msi. but dont mark it as a keypath, use a registry keypath instead
2. Now if its a recaptured MSI, make the shortcut advertised, in which case , if the user specific file is missing, it will trigger a repair.
3. Another option, if u dont wish to advertise the shortcut can be the use of active setup. Create a active setup entry under HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\[ProductName]. Create a stubpath entry as Msiexec /fpu(f-repair, p-missing files, u- missing user specific registry) [ProductCode] /qn
4. Through tables u can make use of Move File table. Refer MSDN for more info on this table and its usage.
Hope u find it useful - talonsprem87 10 years ago
A few questions:
- Will Active Setup work with existing user profiles, including the currently logged in user?
- I'm using an existing .msi so can an existing shortcut be the entry point?
- If I use a reg key as the keypath, do I need to create a new one? Where do I create this and what does it need to be?
Thanks again. - kgpetersen 10 years ago