msi self heal
I have successfully created a mst for a program called Remote Desktop Manager but I'm new to package development and I just want to know if I have done everything correct.
The program comes as a regular msi so no need for repackaging but I wanted to include a configuration that needs to go in the AppData folder in the users profile.
So this is what I did after I installed Wise 8 standard:
1. Created a mst by running InstallTailor and then opened it in Installer Editor.
2. In Setup Editor I added a new feature that I named CurrentUser
3. In Installation Expert I added my configuration file in the install directory of the application in a folder named UserConfiguration, I did this in the feature CurrentUser
4. In MSI Script I clicked on Execute Immediate and did a search for CostFinalize and added a custom Set Directory after the CostFinalize entry, in here I said that it should copy the directory where I saved the configuration file in step 3 to [%USERPROFILE]\AppData\Local\Devolutions\RemoteDesktopManager
5. I added the key HKCU\Software\RemoteDesktopManager\RepairUserProfile with the value 1 in Setup Editor, I also changed the Key path to Registry keypath here
6. I moved the 2 features (Feature & Mainfeature) into the feature I created earlier (CurrentUser)
7. In Installation Expert I edited the shortcut and checked the Advertised checkbox.
Everything seems to work although I find one thing odd. The configuration file is not copied to the installation directory of the application but the self heal works just fine when a new user logs on, it this behavior normal?
The program comes as a regular msi so no need for repackaging but I wanted to include a configuration that needs to go in the AppData folder in the users profile.
So this is what I did after I installed Wise 8 standard:
1. Created a mst by running InstallTailor and then opened it in Installer Editor.
2. In Setup Editor I added a new feature that I named CurrentUser
3. In Installation Expert I added my configuration file in the install directory of the application in a folder named UserConfiguration, I did this in the feature CurrentUser
4. In MSI Script I clicked on Execute Immediate and did a search for CostFinalize and added a custom Set Directory after the CostFinalize entry, in here I said that it should copy the directory where I saved the configuration file in step 3 to [%USERPROFILE]\AppData\Local\Devolutions\RemoteDesktopManager
5. I added the key HKCU\Software\RemoteDesktopManager\RepairUserProfile with the value 1 in Setup Editor, I also changed the Key path to Registry keypath here
6. I moved the 2 features (Feature & Mainfeature) into the feature I created earlier (CurrentUser)
7. In Installation Expert I edited the shortcut and checked the Advertised checkbox.
Everything seems to work although I find one thing odd. The configuration file is not copied to the installation directory of the application but the self heal works just fine when a new user logs on, it this behavior normal?
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Almost! :)
- step 3, add the file to 'Windows\Profiles\Application Data[etc]'
- step 4, not required
- step 5...huh? Does the application use that key? If not, it's not required, either.
- step 6, you only need to move one feature which has an advertised entry-point, such as a shortcut.
- step 7, good, if there no advertised shortcuts already.
- step 3, add the file to 'Windows\Profiles\Application Data[etc]'
- step 4, not required
- step 5...huh? Does the application use that key? If not, it's not required, either.
- step 6, you only need to move one feature which has an advertised entry-point, such as a shortcut.
- step 7, good, if there no advertised shortcuts already.
Posted by:
Matias M Andersen
13 years ago
I have a couple of things to add.
Do not use InstallTailor, it's a horrible tool that WILL apply static references directly in the MSI. Open the MSI with WPS and simply "Save As" and select .mst. This will ensure that you get a clean Transform file.
There is no need for a Custom Action to generate a static directory to apply file(s) to %Appdata% during repair. Either use a "dummy" registry key in HKCU as keypath for the component including the file(s) (as you already have done), or use DuplicatedFile (check the Windows Installer SDK for more information).
If it still fails, create a logfile "/L*v" to see whats going on.
/Matias
Do not use InstallTailor, it's a horrible tool that WILL apply static references directly in the MSI. Open the MSI with WPS and simply "Save As" and select .mst. This will ensure that you get a clean Transform file.
There is no need for a Custom Action to generate a static directory to apply file(s) to %Appdata% during repair. Either use a "dummy" registry key in HKCU as keypath for the component including the file(s) (as you already have done), or use DuplicatedFile (check the Windows Installer SDK for more information).
If it still fails, create a logfile "/L*v" to see whats going on.
/Matias
Posted by:
anonymous_9363
13 years ago
use a "dummy" registry key in HKCUYup, good spot. @OP, keep step 5 :) LOL (It's Friday afternoon, what can I tell you?)
Do not use InstallTailor.I use it all the time! It's the quickest way to create a response transform.
As for static references, these would be taken care of by your patiently crafted exclusion list or by editing afterwards.
Posted by:
Matias M Andersen
13 years ago
I use it all the time! It's the quickest way to create a response transform.
As for static references, these would be taken care of by your patiently crafted exclusion list or by editing afterwards.
Hmmm, I'm quite sure InstallTailor does not have any reference to the Exclusion list. Another thing is that InstallTailor only "captures" changes in the UI which is very easy to manipulate through checking the dialogs and make the appropriate changes in the Property/Control tables. And why introduce garbage to your mst's when (atleast in my opinion) is much easier to generate a clean one and add the required changes directly?
In anycase. Have a nice weekend.. I know I will :o).
/Matias
Posted by:
jmcfadyen
13 years ago
Posted by:
hewwra
13 years ago
Posted by:
Matias M Andersen
13 years ago
ORIGINAL: jmcfadyen
hi Matias,
maybe it would be worthwhile explaining the static references you mention. Seems a lot of people skip over this..
It varies per MSI package, but its quite simpel to test on a random package.
1. Create a MST file using InstallTailor
2. Create the same MST file using "Save as" .mst
3. Use msidiff to compare the 2 transform files
/Matias
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.