View Full Version : Install file if I found a directory
neofar
09-07-2004, 03:13 AM
Hi.
I need to install a file in "c:\example\pef" only if this directory exist. This directory is from another instalation, and I need to put some properties files in this directory BUT ONLY if the directory exist yet.
Any ideas?
SUF6NEWBIE
09-07-2004, 05:55 AM
Hi there...A few thoughts..
Some actions in the "on startup'
Consider establishing if any file exist in your target folder
use the file find action and use *.* as your search criteria
create a variable to return the result of the file find eg: %TargetFolder%
establish if returned true or not
you could then assign a control install value for eg: %TargetExist% = true
In your Build Environment "Install conditions" select your 'to install' files
and assign the condition eg: if %TargetExist = true
Sorry about the syntax , just look up the actions etc for correct syntax
As long as you have established wether true or false in the BEFORE Installing sequence you should be good to go..
Have a look at the "installfile" action...this is an alternate method which
is essentially a copy file action but with more copy 'conditions' controls
Hope Helps a little
neofar
09-07-2004, 06:59 AM
I was searching to do it with the conditions of a file...
but finally I get with this "after installation" actions:
Searchr for file ("%FileSearchResult%" = location of app.exe)
IF (%FileSearchResult% <> "NOT FOUND")
Copy Files (%AppDIR%\MyFile.txt -> c:\MyDir\MyFile.txt)
END IF
app.exe its then executable in "c:\MyDir" that I'm searching for, if I found the executable I copy my file in this directory
Works fine
Thnks
SUF6NEWBIE
09-07-2004, 08:25 AM
Good Job...glad you got it working.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.