bros
Posts: 3
Joined: Tue Feb 05, 2013 3:05 pm

Copy a named file in APPDIR

Hi

I'm new to Advanced Installer and i have a question.
How can i copy a file that i put in the same dir as the installer.

This file is different in many case (the name is always the same, only the content is different) so i can't join it directly into the installer.

Thanks in advance

Bros
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy a named file in APPDIR

Hi Bros and welcome to Advanced Installer forum.

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can create a property-based folder and make a file copy/move operation.

To create a property-based folder you can follow the steps below:
- go to the Install Parameters page
- create a new property and name it MY_DIR (you can use any name you want as long as it contains only uppercase letters)
- set the value of this property to the path where is located the file you want to copy (i.e. D:\My Folder)
- go to the "Files and Folders" page
- use the [New Folder] toolbar button and create a property-based folder by using the property you created

To create the file copy/move operation use the "File Operation" toolbar button and follow the File Copy/Move Dialog tutorial. Make sure you use the property-based folder you created as a source folder.

Let us know if this helped, otherwise give us more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bros
Posts: 3
Joined: Tue Feb 05, 2013 3:05 pm

Re: Copy a named file in APPDIR

Hi

Thanks for your quick answer.
I think it can work like this but i want the file to be near the MSI file i created for the installation, not in a directory like d:\mydir or z:\install files\ini\....

How can i say that my_dir is the msi dir?

Thanks
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy a named file in APPDIR

Hi,

In this case you can go in the Custom Actions page and create a "Set installer property" custom action below the "Wizard Dialogs Stage->Searches" action group with the following configuration:
  • Property: MY_DIR (be sure "MY_DIR" property is written in uppercase letters)
    Formatted: [SourceDir]
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bros
Posts: 3
Joined: Tue Feb 05, 2013 3:05 pm

Re: Copy a named file in APPDIR

Sorry for the late answer ...

It works great.

Thanks a lot
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy a named file in APPDIR

You're welcome. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rbell@maxrecall.com
Posts: 6
Joined: Mon Dec 09, 2013 7:20 pm

Re: Copy a named file in APPDIR

How do I copy file if I am running from the .EXE?

The [SourceDir] mentioned here points to the user/.../roaming/... directory that the .MSI is unpacked into. I need to move a file that resides in the original .EXE directory.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy a named file in APPDIR

Hi,

In order to achieve this you can use the [SETUPEXEDIR] property which contains the path to the directory that contains the EXE file.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rbell@maxrecall.com
Posts: 6
Joined: Mon Dec 09, 2013 7:20 pm

Re: Copy a named file in APPDIR

[SETUPEXEDIR] has blue squiggly lines under it in the installer tool and says "Missing property/folder".
rbell@maxrecall.com
Posts: 6
Joined: Mon Dec 09, 2013 7:20 pm

Re: Copy a named file in APPDIR

Looks like the value I was looking for is [AI_SETUPEXEDIR]...maybe? As I still can copy a file (it is copying a directory), I don't know if this is correct.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Copy a named file in APPDIR

Hi,
[SETUPEXEDIR] has blue squiggly lines under it in the installer tool and says "Missing property/folder".
I'm not sure why you encounter this behavior, I tested it and it worked well to me. Please make sure that you create your property based folder like described in the Folder Operations in the Files and Folders Page article.
Looks like the value I was looking for is [AI_SETUPEXEDIR]...maybe? As I still can copy a file (it is copying a directory), I don't know if this is correct.
I'm not sure why you got under the impression that this may be the property you need, but as far as I know this property does not exist in Advanced Installer.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”