tags:

views:

245

answers:

1

I note that there are many subfolders in the common appdata folder and many entries under hkey_local_machine for software on my windows 7 system. I'd like to know how there entries were created presumably when the software was installed and what enables the programs to get at them.

Are there facilities in the .msi files to make these folders and registry entries and establish proper rights to them?

A: 

Regarding Registry entries, the "Registry" table in the MSI file creates the Registry entries.

Regarding the common AppData folder, this property: "CommonAppDataFolder" is what MSI files use to refer to it.

Regarding permissions, the "Lock Permissions" table is responsible for setting permissions.

Theoretically, the owner/creator of the files/Registry settings is obvious, and you can look inside the corresponding MSI file with Orca to see how it was created. Otherwise, you might have to enable auditing, or use a tool like RegMon/FileMon from Sysinternals to see who is creating the entries.

William Leara
Thanks. I managed to use Orca to add a registry key. Have not tried to add a file to commonappdata or diddle permissions. Now I have a hundred more questions but will try to confine myself to a few. 1) I don't understand how the installer is affected by extant permissions. What happens if the user initiating the install doesn't have the permission to do the actions (create file or registry) specified? 2) What is common practice for apps requiring such resources? Install as ADMIN seems a bit extreme. Asking the ADMIN to do set permissions b4 hand or create them also weird.
Mike D
1) In XP and previous, non-admin users who tried to install applications to areas they didn't have write permission (Program Files, for example) would have the install fail. In Vista and forward, non-admin users can enter the credentials of an admin during elevation, and the install will proceed.2) One common practice is to use the MSI feature "advertisement". This allows an admin to "bless" installation of a package. The package is not installed until the non-admin user tries to access it (via shortcut, COM interface, etc.) and at that point the install inheirits the admin's credentials.
William Leara
@William Leara: Using Orca, I added a key to hkey_local_machine and also adjusted it's protection. I started with a simple .msi made by MSICREATE containing a .exe, .txt, and .chm). I used the COMPONENT id of the .exe when creating the key. I then started over and made a transform with the same action. I can apply (using orca) the transform to a new version of the .msi BUT the component has changed when I remade the .msi so now I have a link to a nonexistant component. Is there some way I can make a fixed reference to an existing component or make a new component for this purpose?
Mike D
Is there any symbol for the key valus in orca standing for the current date?
Mike D
Maybe I don't know what transforms r for. I was hoping I could apply the transform after I made a new .msi My experience is that when I apply the transform and "Save Transformed as" I get a much smaller .msi that doesn't contain need information.
Mike D
Re above comment on small size. I 'fixed' this by turning on the 'copy embedded streams during save as' flag in the tools->options under database.
Mike D
Have you considered using an MSI authoring package like InstallShield or WiX? I mentioned Orca as a way to interrogate an .MSI file to see what it's doing, but it's not really meant to author packages.
William Leara
That would be the best course but I don't have time to install WiX now and the price of InstallShield is a barrier so I'm looking for a temporary expedient. Thanks very much for your help!
Mike D