Shortcuts, Working Dir - Advanced Installer Community
jlar310
Posts: 2
Joined: Tue Feb 14, 2017 5:22 pm

Shortcuts, Working Dir

We deploy an app at our company as a per-user install. The binary files go to C:\Users\username\AppData\Local\OurCompany, but the shortcuts are created sometimes in the roaming profile, sometimes to the local profile (Windows 7). I have not been able to determine any reason for the variation.

The problem is that as users roam from machine to machine, sometimes Windows creates their local profile directory with ".DOMAIN" at the end, sometimes not (where DOMAIN is our Active Directory short domain name). So the path to the binary files for our app may vary depending on the machine. That's fine if you don't roam, but if you do move around, with shortcuts in the Roaming profile, sometimes the shortcuts are not pointing to the correct AppData path.

In Advanced Installer, I create my shortcuts in the "Application Shortcut Folder" area. Under Install Parameters, my Application Shortcut folder is defined as [ProgramMenuFolder][ProductName]. Yet the final shortcut location is inconsistent. Usually the base path is AppData\Roaming\Microsoft\Windows\Start Menu\Programs, but occasionally the shortcuts are in AppData\Local.

For the record, this is a Java app and the path to our binary files is needed in the "Working Directory" part of the shortcut. Currently I have the working directory property in the shortcuts set to "APPDIR".

I can think of two ways to fix this, but I don't know how to implement either in Advanced Installer:

1. Make the Working Directory property of the shortcuts be "%LOCALAPPDATA%\OurCompany" so that the environment variable is expanded at run-time and always points to the correct folder regardless of the user profile path on any particular machine.

2. Force the shortcuts to be per-machine, stored in AppData\Local, not AppData\Roaming.

I tried making a user defined property with the content of "%LOCALAPPDATA%\[ProductName]" but when running the installer I get an error "Could not access network location %LOCALAPPDATA%\OurCompany".

I'm using the free version of AI. Would I have more options with the paid version?
jlar310
Posts: 2
Joined: Tue Feb 14, 2017 5:22 pm

Re: Shortcuts, Working Dir

A slight correction (due to memory failure). Our Roaming AppData is redirected to a UNC path on a server. Shortcuts always land in AppData\Roaming, but sometimes they go to the network location, sometimes they go to C:\Users\username\AppDAta\Roaming. Shortcuts never show up in AppData\Local. But having them on the local drive per-computer keeps everything working because they are specific to that machines user profile folder.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Shortcuts, Working Dir

Hello and welcome to our forums,

Thank you for your follow up and for sharing your findings with us. Certainly this info will be useful to future users.

To install your shortcuts under %LOCALAPPDATA% you can go to "Files and Folders" page and just drag and drop the shortcuts under the "Local Application Data" folder.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”