When making an installer I want Setup Factory to copy a folder to the location c: \ users \ name \ AppData \ Local, but I can't do it from the program options, I'm not a programmer, so far I have been able to make installers to other locations but not to that location, whatever I put, I get a message saying that the folder cannot be created.
Announcement
Collapse
No announcement yet.
Path of installation folder in c:\users\name\appdata\local
Collapse
X
-
You did not show the Lua code you are using, which makes answering your question more difficult than it could be.
You might be forgetting to escape the backslashes in the path properly, for example - this could easily cause the error message you mention. I suggest that you read the User's Guide, so you understand how to work with files, paths and session variables.
Here is an example script for copying a file into a new folder created in the user's local application data folder.
Code:-- Save the LOCALAPPDATA folder path in a session variable SessionVar.Set("%LocalAppDataFolder%", Shell.GetFolder(SHF_APPLICATIONDATA_LOCAL)); -- define the name of the target folder local sTargetFolderName = SessionVar.Expand("%LocalAppDataFolder%\\My Folder Name"); -- create a folder in LOCALAPPDATA Folder.Create(sTargetFolderName); -- copy a file to LOCALAPPDATA (the target folder must already exist for this to work) File.Copy("full-path-to-source-file-name.ext", sTargetFolderName);
- Define the session variable in the On Startup event script
- Set the target folder for the desired files as needed
If this does not help, even after reading the documentation I suggested, please post your project and the error message you receive.
UlrichLast edited by Ulrich; 12-28-2020, 06:37 PM.
Comment