Not Writing A New Folder If It Exists - Unusual Issue Here - 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!

Colorguy
Posts: 14
Joined: Thu May 02, 2013 5:18 pm

Not Writing A New Folder If It Exists - Unusual Issue Here

My installer needs to place a new folder that also includes a file to a pre-installed application. This folder, for example "XYZ" isn't usually a part of the target application on the end users machine, but may have been created by the end user or a competing product's installer. I have no way of knowing this.

So, what I need to do is write the file to the XYZ folder (if it exists).
However, if the XYZ folder doesn't exist, my installer then writes the XYZ folder and the file contained inside.

I've set up property based folders that contain an XYZ folder with my file inside. The problem is, if the folder exists on the end users machine, this method writes another copy of the XYZ folder inside the pre-existing XYZ folder. I do realize I could overwrite the XYZ folder but would rather not.

I'm sure there's an easy way to solve this. Thanks again.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Not Writing A New Folder If It Exists - Unusual Issue He

Hi,

Creating a property-based folder, as you mentioned, should do exactly what you need. For example, if the path to your XYZ folder is "C:\XYZ" and your property-based folder is set to "C:\XYZ", then if the folder "XYZ" exists on the end-user machine during the installation, it will not be created again and the file will be installed in the existing folder. Otherwise, if the folder does not exist on the end-user machine, the folder will be created and along with the file it contains.

I'm not sure why it does not work for you, can you please give us more details about your scenario, maybe explain to us the steps you followed?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Colorguy
Posts: 14
Joined: Thu May 02, 2013 5:18 pm

Re: Not Writing A New Folder If It Exists - Unusual Issue He

I made some changes and now all works. In my old installer from almost 2 years ago, there was no possibility this folder existed on the end-users machine so I had an XYZ folder within my property based folder containing the file. However now if XYZ folder exists, this configuration writes an identical folder inside a pre-existing one.

So just adding the file itself to my Property Based Folder and including the XYZ folder to the Property fixed it.

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

Re: Not Writing A New Folder If It Exists - Unusual Issue He

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”