Dknoll
Posts: 2
Joined: Sat Sep 27, 2014 4:05 pm

Delivering a file to AppDataFolder\myfolder

Hello,

I'm having issues delivering a file to all users profiles. I have created an installer package based on these instructions:

http://www.advancedinstaller.com/forums ... =2&t=23231

Yes, you can do that. You can create a property based folder using a property having its value set to the desired path. Here are the steps to proceed:
1. go to "Install Parameters" page and add a new public property (e.g. MY_PROP)
2. go to "Files and Folders" page and create a property based folder using the "MY_PROP" property
3. go to "Custom Actions" page and add a "Set installer property" custom action with sequence, scheduled after "Wizard Dialogs Stage -> Searches" actions group, like this:
Property: MY_PROP
Value: [WindowsVolume]Users\[LogonUser]\custom_folder\mydata4. select the above custom action and, while keeping the [SHIFT] key pressed, drag and drop it under "Install Execution Stage -> Searches" actions group (the custom action will be shared between both execution stages)
5. build and test the project


My package works for the user that installs the .MSI but the folder and file doesn't get copied to any other users profiles. Any ideas on what I my be missing? I'm using version 10.7.1 build 53900

Thanks for any help or direction,
Dave
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Delivering a file to AppDataFolder\myfolder

Hi Dave and welcome to Advanced Installer forums,

This is happening because you are copy the related file only for the [LogonUser], and not for each user registered on the machine.
The detailed answer provided by my colleague Daniel, was to the last reply of the user request, to copy a file to the current user profile.

In order to copy a file into the AppData folder for each user you need to implement the self healing mechanism.
So, you can create a per-machine installation type and, then add the related folder under "Application Data" folder in "Files and Folders" page.

Now you should create your application shortcut as an advertised shortcut and you should use the self healing feature to automatically install resources to per user location. Also, please make sure that in the "Organization" page the resource files components (from your test folder) are added under the same feature as your advertised shortcut component.

If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dknoll
Posts: 2
Joined: Sat Sep 27, 2014 4:05 pm

Re: Delivering a file to AppDataFolder\myfolder

Thanks for the reply Dan.

I completely forgot to mention that for this package, I am simply delivering a file to each user that logs in. The actual installation of the software is handled by another installer and this file just sets server preferences. Is there a way to do this without an advertised shortcut?

Dave
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: Delivering a file to AppDataFolder\myfolder

Hi Dave,

Yes, this can be done using the Window Active Setup process. Windows Active Setup is a process that runs automatically when a Windows user logs in.

When the active setup is used, the following keys are compared:

Code: Select all

HKLM\Software\Microsoft\Active Setup\Installed Components\[ProductCode]

Code: Select all

HKCU\Software\Microsoft\Active Setup\Installed Components\[ProductCode]
If the HKCU registry entries don't exist, or the version number of HKCU is less than HKLM, then the specified application is executed for the current user. So, when each new user logs on, the operating system compares Active Setup keys between HKLM and HKCU, and runs the command line in StubPath if the HKCU entry is missing or the version in HKCU is less than HKLM.

Under HKLM registry key, create a registry value such as:
"StubPath"="msiexec /fou {ProductCode} /qb"
and another one registry entry for the version:
"Version"="2,0,0"
Please note that if using more complex version numbers, use a comma as delimiter and not a period, eg: 2,0,0 not 2.0.0

Then, you can create a property based folder using a property having its value set to the desired path. Here are the steps to proceed:
  • 1. go to "Install Parameters" page and add a new public property (e.g. MY_PROP)
    2. go to "Files and Folders" page and create a property based folder using the "MY_PROP" property. Add in this folder the related config file.
    3. go to "Custom Actions" page and add a "Set installer property" custom action with sequence, scheduled after "Wizard Dialogs Stage -> Searches" actions group, like this:
    • Property: MY_PROP
      Value: [WindowsVolume]Users\[LogonUser]\custom_folder\mydata
    4. select the above custom action and, while keeping the [SHIFT] key pressed, drag and drop it under "Install Execution Stage -> Searches" actions group (the custom action will be shared between both execution stages)
    5. build and test the project
The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

Please let me know if this is working as expected.

Best regards,
Dan
Attachments
Active Setup Sample.zip
(2.83 KiB) Downloaded 531 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sarpersozen
Posts: 3
Joined: Fri Oct 25, 2019 8:20 pm

Re: Delivering a file to AppDataFolder\myfolder

My adminstrator account name is "Quince" on Windows 10. To test Active Setup Sample.zip example, I created an account "Test" and tried ActiveSetupSample.msi. C:\Users\Quince contains custom_folder. But C:\Users\Test does not contain custom_folder. So I did not manage to deliver custom_folder to all users' directory. And unfortunately I don't know where is the problem.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Delivering a file to AppDataFolder\myfolder

Hello and welcome to our forums,

We started investigated on this and as soon as we have a resolution we will let you know.

Thank you for your further patience on this.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Delivering a file to AppDataFolder\myfolder

Hi,

We tested the scenario but we cannot replicate the issue.

Can you please make sure that, after installing the sample setup package, you sign in under your "Test" user account and then look for the "custom_folder" folder. Excepting the user account under which the installation runs, the related folder will be created for the other user account at the first sign in operation after the setup package was installed.

If this still doesn't work on your side, then please let us know the Windows 10 version you are running your test onto.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sarpersozen
Posts: 3
Joined: Fri Oct 25, 2019 8:20 pm

Re: Delivering a file to AppDataFolder\myfolder

Good morning. I'm surprised now. I thought I could see other users' files from the Administrator account. But that wasn't possible. This is related to Windows. There are no problems in the scenario. I'm sorry I'm tired of you guys. Sincerely...
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Delivering a file to AppDataFolder\myfolder

Don't worry, thank you for your follow up on this.

I'm glad you got this sorted out.

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

Return to “Common Problems”