Just trying to see if it's possible to create a custom variable for "\User\%username%\AppData\Local". I know it's possible to use %ApplicationDataFolder% to get to "\User\%username%\AppData\Roaming". Sorry for the ignorance kinda newbie.
Announcement
Collapse
No announcement yet.
App Data LocalFolder Folder
Collapse
X
-
You can, as long as you define a custom Session Variable and initialize it properly in the On Startup event script.
You can then use this custom Session Variable in the same manner as the built-in in scripts:
You can use it also as target path for deployment:
Ulrich
-
👍 1
Comment
-
-
This solution does work on Windows if you are installing as the Administrator Level user for that Administrator level users to use. However if you need to install it for a different users for instance user Anthony (a non admin user), I could try to install it in admin and %LocalAppData% will point to something like C:\Users\Admin\AppData\Local\ which will not work for the Anthony user. If I try to install with Anthony I will get an admin prompt, but it will still install under C:\Users\Admin\AppData\Local\ when I want it to install as C:\Users\Anthony\AppData\Local\.
Do you have any suggestions on the best way to resolve this?
Comment
-
-
It is a bit unclear what your application requires, if I misunderstood, please explain a bit more. The process with admin rights should most likely not deploy files into the user's profile, because by default the user will be unable to change those files later, as he isn't the owner.
I assume that you are attempting to install an application, and each user has his/her own custom files in the profile. So one way to handle this is deploying the files as admin in the ProgramFiles and ProgramData folder as needed. Your application, on the first execution when it is unable to find the expected files in the user profile, could copy the default files from ProgramFiles or ProgramData into the desired folder in the user's profile, where they later can be updated with the user's settings. As the application is running in the user's context, the copied files and created folders will receive the proper access rights so the can be updated at runtime during normal operation of the program.
When another user on the same PC runs the application, again, the files would be copied once if they cannot be found, and accessed from that moment on for later uses.
Unless the application should not be shared will all users, in this case the setup also could not be run "as administrator" but "as invoker" instead, and you would be able to deploy everything into the user's profile, instead of using ProgramFiles or similar shared folders.
UlrichLast edited by Ulrich; 04-09-2020, 09:03 PM.
Comment
-
-
Thanks Ulrich, for your help on this, yes our development software does work like this on macOS, but unfortunately doesn't work this way on Windows. On Windows each user needs specific files in their Users\UserName\AppData\Local\ProgramName folder. It's not the greatest solution for deploying. I am going to contact the company to see if there is a way to deploy since the startup routines may not be editable for us.
Comment
-
Comment