s4duser
Posts: 3
Joined: Thu Jul 23, 2020 4:38 pm

Only Install Files if Folder Exists

Hi all. I'm using a pretty old version of Advanced Installer (11.8) but I want to install files to a specific folder, only if it already exists on the PC. I don't want to create the folder, I only want the installation files to be put in there if it is already present. I'm sure it must be really simple but can't see an obvious way to do it. Any help?
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Only Install Files if Folder Exists

Hi,

Please see a similar scenario described in the "Setting APPDIR to dir on a drive which may not exist" thread.

Let me know if that helped.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
s4duser
Posts: 3
Joined: Thu Jul 23, 2020 4:38 pm

Re: Only Install Files if Folder Exists

Hi Eusebiu. Thanks for the direction and I've tried to follow it but am getting nowhere.

I create my search (pic1) and my custom action (pic2) although I'm not sure what the value is supposed to be.

I then am unsure how to use this custom action. I thought I might need to create a new property based folder using the custom action, but whether the C:\pgSQL directory is present or not it creates a directory on the C drive called PGSQL_FOUND and puts the files and directory into it (pic3).

A little.....confused.....
Attachments
pic1.png
pic1.png (7.7 KiB) Viewed 14889 times
pic2.png
pic2.png (50.14 KiB) Viewed 14889 times
pic3.png
pic3.png (1.98 KiB) Viewed 14889 times
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Only Install Files if Folder Exists

Hi,

A custom action is not necessary for this. Just create a property-based folder that points to the "C:\pgSQL" location (e.g. PGSQL_FOLDER) and move all the files into that folder. Then, go to the "Organization" page, select the feature containing all the resources, check the "Not Installed" option for it and write this condition in the "Installed if" field: PGSQL_FOUND

Let me know if you have other questions.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
s4duser
Posts: 3
Joined: Thu Jul 23, 2020 4:38 pm

Re: Only Install Files if Folder Exists

Hooraa! Works perfectly.

Many thanks Eusebui.
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: Only Install Files if Folder Exists

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

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

Return to “Common Problems”