IS/MSI gurus: Folder properties resolve to improper paths at repair
Most of the time, I am editing vendor msi/installers... This time I am creating my own, running into issues creating my own basic msi with InstallShield 2012 spring (tested behavior on 2011 too).
After much digging, I am finding that any folders I create in a I.S. pre-defined folder/property (in this case [LocalAppDataFolder]\Microsoft) seem to have a set path for the first user that runs the msi. So when I run a self-heal/repair the user profile data is rewritten to the original profile, not the current profile running the repair.
I have tried changing the directory table key column to all lower case to remove the public property, just in case the property is allowed throught the various phases.... No go... Though if I just put my files in the root of the pre-defined folder, repair works properly. Pretty stumped here guys...
Here are some snips from the log of a repair, run as test2 user. test1 user initially installed the applicaiton.
Initial getfolderpath lines... all seem proper with the proper paths for test2 user.
00086: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\Application Data 00087: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\Favorites 00088: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\NetHood 00089: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\My Documents 00090: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\PrintHood 00091: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\Recent 00092: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\SendTo 00093: (Server): MSI (s) (FC:04) [14:53:34:837]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\Templates 00094: (Server): MSI (s) (FC:04) [14:53:34:847]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\All Users\Application Data 00095: (Server): MSI (s) (FC:04) [14:53:34:847]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\Local Settings\Application Data 00096: (Server): MSI (s) (FC:04) [14:53:34:847]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\test2\My Documents\My Pictures
Then during Cost Finalize, directory table keys/lines are created as Public Properties, but using the old path from initial installation by test1 user, instead of test2 path...
00193: (Server): MSI (s) (FC:04) [14:53:34:867]: PROPERTY CHANGE: Adding MICROSOFT property. Its value is 'C:\Documents and Settings\test1\Local Settings\Application Data\Microsoft'. 00194: (Server): MSI (s) (FC:04) [14:53:34:867]: PROPERTY CHANGE: Adding OFFICE property. Its value is 'C:\Documents and Settings\test1\Local Settings\Application Data\Microsoft\Office'.
Answers (2)
Hey Piyushnasa, any clue why it does that? The only thought that comes to me is because the property isn't public [LocalAppDataFolder]... I tried a similar method below with the LocalAppDataFolder and it did not work at all, so I assume public property is key.
Thanks for the idea... I fixed it like this...
1. Added [USERPROFILE] pre-defined folder in Installshield Files and Folders..
2. Created a folder under [USERPROFILE], name doesn't really matter since it will be changed later... I used "Office", since that was the last dir in the path I need.
3. Created a type 35 Set Directory Custom Action. Directory Name: OFFICE (directory column from dir table), the same as created above. Directory Value: [%USERPROFILE]\Local Settings\Application Data\Microsoft\Office\
4. Added CA to execute seq, right after CostFinalize action
5. Set any files/components I wanted to install to the original [USERPROFILE]\Office directory I setup in step 2, the CA will change to the path you actually want during install.
I have to support both XP and Win7, so I will create another CA to change the dir to the Win7 path and condition both CA based on OS NTverion.
Thanks!