Installing Files to APPDIR from external folder - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Installing Files to APPDIR from external folder

Hi guys,

I am looking to install some files to the APPDIR from a folder that is external to the our msi file. Is this possible to do without using a script? I have created a script that works but I wondering if there was a better way?

Example:
I have an msi called MyInstaller.msi and in the same folder as MyInstaller.msi I have a folder called "extra". When the msi is ran I would like to move/copy all the files from the "extra" folder into the APPDIR.

Thanks for any help
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installing Files to APPDIR from external folder

Hi,

You can use a File copy operation to copy the contents from that folder to APPDIR. Using wildcards is supported.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

Brill... thanks will look into this.
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

I've had a look and I think it's what I need.

A couple of things though:
1. What happens if the folder doesnt exist? Will it ignore the error and just continue?
2. I can't choose SOURCEDIR as the source folder (the folder the msi is running from). Is there any way to do this?

Many thanks,
Lee
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installing Files to APPDIR from external folder

Hi Lee,

1) Nothing happens, no error will be displayed. The installer will simply go on
2) I have attached a sample project.

Note the following in the sample:
- the MYSOURCE property in the Install Parameters page
- the property based folder on the Files and Folders page
- the custom actions on the Custom Actions page. The Property Set with Formatted custom actions need to be both in InstallUISequence and in InstallExecuteSequence. This is because on silent installs InstallUISequence won't execute, in which case MYSOURCE is set during the InstallExecuteSequence.

Regards,
Gabriel
Attachments
sample.zip
(317.32 KiB) Downloaded 542 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

Just downloaded it, tested and works as expected.

Easy when you know how :]

Brilliant support, thanks.
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

Sorry to be a pain ....

I tested the project you made on the latest version of Advanced Installer (which I have installed on a VM as a trial), this worked fine.

However, I replicated the project using our purchased version (v6.7.1) and it doesn't seem to work but I may have done something wrong. Is this functionality present in 6.7.1?

Many thanks,
Lee
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

As a matter of fact it sort of works.
The default location for the MYSOURCE is set to C:\ like in your example. If i put the folder on the C:\ root then it copies the files to the APPDIR. Looks like the MYSOURCE location isn't being updated.

I've logged the output from the msi and I think that the custom actions may be failing. It appears that the custom action isnt running.. will do some more checking now
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installing Files to APPDIR from external folder

Hello,

You can try using "SourceDir" instead of "SOURCEDIR" in your project and see if that solves the issue.
Also note that many bugs have been fixed since 6.7.1, so that might also be a cause.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

Ok figured it out..

Yeh I had to change [SOURCEDIR] to [SourceDir] and it worked in a sample script i made.

With our script though we tick "Limit to basic user interface (simple progress and error handling)"

When this is ticked then the custom actions on the "InstallUISequence" are not called. I tried moving the custom action from "Begin" to "AppSearch" under "InstallUISequence" and this still didn't work even with your project and compiling with the latest version.

Any idea? Will see if I can work it out in the mean time.,

Thanks
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installing Files to APPDIR from external folder

Hello,

There is no InstallUISequence when run with basic user interface. Only custom actions under InstallExecuteSequence will be executed.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

Ok ..

Using the sample app you gave me i ticked "limit to basic user interface" using the latest version of AI.

The custom action under "InstallExecuteSequence"->"AppSearch" doesn't seem to work. I also tried moving it to "Begin","InstallInitialize" and "install" and still it doesn't see to work.

I logged all the output from the msi to a log file and it mentions this:
Action start 6:29:54: PropertySource_1.
Action ended 6:29:54: PropertySource_1. Return value 1.
.. so it looks like something is happening.

Could you test with your project? I've got no idea why it doesn't work?
Thanks for any help.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Installing Files to APPDIR from external folder

Hello,

I have attached an improved version that should also work with basic interface.
Note the following changes in the project:
- new Property Set with Formatted under AppSearch. This is to have a valid folder path in MYSOURCE. Otherwise, file costing would fail. Also it appears C:\ is not considered a valid path by Windows Installer which is why we set the initial path to the fonts folder.
- moved the previous Property Set with Formatted under ProcessComponents. This is when SOURCEDIR gets resolved.
- on the Organization page, MYSOURCE component is conditioned to only install during a first install, not a repair. This is to prevent the folder operation to attempt to execute during a repair. SOURCEDIR is not evaluated during a repair which means the copy operation would fail.

Regards,
Gabriel
Attachments
sample.zip
(209.67 KiB) Downloaded 547 times
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
leetuck
Posts: 12
Joined: Tue Jun 16, 2009 1:44 pm

Re: Installing Files to APPDIR from external folder

Thank you very much for all your help.
akielbas
Posts: 1
Joined: Wed Jul 21, 2010 9:04 pm

Re: Installing Files to APPDIR from external folder

Hello,
Do you have any recommendation on how to make the MYSOURCE directory copy optional? So copy files from MYSOURCE if the directory/files are there, but don't do anything if not. With your sample it looks like the directory is created if it is not there during install, any way to avoid this?

Thanks,
Andrew

Return to “Common Problems”