chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

search files in network location

Hi,
Thanks for your content help in building the installer,
I HAVE A requirement where my installer should check for one file in network shared location . If that file is available then it should proceed for installation .
I already know about search file utility , And it seems its not working for shared network location. Also please let me know how to use the search results (output ) .
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: search files in network location

Hello,
I HAVE A requirement where my installer should check for one file in network shared location . If that file is available then it should proceed for installation .
I already know about search file utility , And it seems its not working for shared network location.
The search operations from the Search page are executed by the standard AppSearch action. This action does not seems to search on a network location.

To overcome this you can create your own custom action. For example, you can take advantage of the DriveInfo Class that provides access to information on a drive (e.g. get the DriveInfo.DriveType Property that gets the drive type, such as CD-ROM, removable, network, or fixed.). If the DriveType is network, then you can check if the file is there using the File.Exists Method. You can also take a look on the Directory.GetFiles Method (String) article which may be useful to you.

To integrate your custom action in the installation package, please follow the steps from the How to integrate and debug custom actions? article.
Also please let me know how to use the search results (output ) .
Please note that when a search operation is added in the search page, a property is automatically added (the default one is RESULT_PROPERTY). The related property contains the value of the search result. For a search file operation, the property would be set with the path to the related file. If the property is not set, then the file does not exist.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
chandrabhushan
Posts: 76
Joined: Thu Jul 02, 2015 10:58 am

Re: search files in network location

Thanks for the reply,
Ok, So i gave up the network search, I will Do a workaround for that, And copy n/w file to my systems Temp Directory.
Now I want like this :-
1. I will run a batch file to copy the network file from shared network (file1.txt ) to my TEMP directory .
1.(a) - if file copies it means i am in the network (that's what i want to achieve) if not i'm outside of company network .
So once file is copied
2. I want to search for it .and
2.(a) - if file is there it should continue installation .
2.(b) - if not it should abort .
ultimately I want to know how to use the results returned by search tool .
Thanks .

Return to “Building Installers”