Advertised shortcut executes but doesn't resolve APPDIR correctly since the property behind APPDIR is already set with the prior users value
I need advice on how to make the installer reset the property and conduct the search (registry search) again so that APPDIR will be set with the new users installation path (which is in HKCU)
I might add that it all works perfectly for the first user.
I am not sure I fully understand. Are you referring to changing the target (which uses APPDIR property) of an advertised shortcut installed by a previous version during an upgrade installation?
If this is not the case please be more specific and exemplify what you mean.
The user that installs the application (not really an app, just a bunch of Office Template files)
A registry search is conducted in HKCU and the path to the UserTemplates folder (MS Office) is set to variable REG1
Then I have a Custom action under:
InstallUISequence
--Begin
--Appsearch
---PropertySource_1, property set with formatted: APPDIR | [REG1] | Execution condition: REG1
and that works fine for this first user, APPDIR is correctly set to whatever is in the UserTemplates key this way.
The problem arises when the next user logs onto the computer and clicks the Advertised Shortcut, because REG1 is still set to the first users UserTemplates value and since in this case the the value points to a folder on the first users Desktop, the new users installation (template files) is done in C:\APPDIR, and I mean literally such a folder is created since the path is of course not valid for the new user.
My problem is thus: how do I make the installer conduct a new search for the location of the current users UserTemplates folder?
You can try to share that "Property set with formatted" custom action after the InstallExecuteSequence -> AppSearch as well (drag&drop while holding Shift key). Also, you should enable its "Execute only once if present in both sequence tables" scheduling option.
FOLLOW US
Get the latest news in Application Packaging