File Search - if found use instead of what's in setup?? - 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!

digitalman
Posts: 36
Joined: Mon Oct 30, 2006 7:55 pm

File Search - if found use instead of what's in setup??

I need to search for an existing access database that will always be in same place if installed and if there use it instead of the one in the install package. I've create a file search under the Search section. How can I now accomplish what I need? I had originally thought to wait until after the install and then just copy the file over if it existed but then thought about a user who might install to the same folder as the old install.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

You mean to never overwrite the file if already exist? If this is what you need then switch to organization page and mark the component associated with the file as "Never Overwrite".

Please let me know if this is not what you want.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
digitalman
Posts: 36
Joined: Mon Oct 30, 2006 7:55 pm

Hmmm, I had replied to this before but my session must have ended or something as it never posted.

Basically there exists an old install of the app we're proposing writing this new install for. The old install always installed to the same location (a folder on the root of the C: drive). One of the files installed is a mdb database. They're asking us with this new install we're building with AI to check for that file and if it exists bring that into the new install location instead of the blank mdb included in the new install. So if an existing database is not found the install will just go ahead as normal. If it is found I want to copy the existing database into the new install target instead of the one in the package. I have created the search param in AI but am not sure how to use it. My first thought was to let the install run normally and then copy the old database over as a post procedure. But then I realized the person might install to the same folder the existing app was installed to. This would probably be rare as we'll default to "Program Files" but still. So I'm thinking to maybe copy the existing database to a temp folder/file and then after install completes copy it over with batch file or something. Unless there's an easier way in AI. Either I'm not sure from reading the documentation how to use the search variable I created in AI to do anything.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

We have a tutorial on how to prevent a file from being replaced by a newer version. For more details please see:
http://www.advancedinstaller.com/user-g ... le-ca.html

Please let me know if you encounter any problems.

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
digitalman
Posts: 36
Joined: Mon Oct 30, 2006 7:55 pm

This seems like it should do the trick. I've been playing with this and modifying to my need. For testing I have MsgBox statements in the code. When I uninstall the app I see the message pop up also. How can I keep the scripts from running during uninstall?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Use (Not Installed) as execution condition for the custom actions. With this condition the CA will be executed only at install.

Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”