Search for a file always returns true? - 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!

marcelo
Posts: 103
Joined: Fri Sep 28, 2007 2:07 pm

Search for a file always returns true?

Hi there,

I don't know what i'm doing wrong but it seems that the search is always returning true.

I created a new search as follows:

PropertyName: SHAREPTEXIST
FileToSearch: Microsoft.SharePoint.dll
Directory: [ISAPI_DIR]

The ISAPI_DIR is: C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\ISAPI

a folder where I will install some dlls.

This search seems to be returning true every time when I check if:
SHAREPTEXIST = true (on launch conditions)

Also when I run the "test" for the search, it always return "1: " even if the file is not in the folder.

What am I doing wrong?

Thanks
Marcelo
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

If the search is successful (it finds the file) then it will return the path, if it isn't successful it will return nothing (""). Therefore, in order to condition the SHAREPTEXIST property you can use the conditions SHAREPTEXIST (the search is successful) and Not SHAREPTEXIST (the search found nothing).

Please note that you need to specify a correct value in the "Depth" field in order to find the file (in your case the depth will be 0).
Also when I run the "test" for the search, it always return "1: " even if the file is not in the folder.
The search actually returns nothing ("1:" is not included in the search result).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
marcelo
Posts: 103
Joined: Fri Sep 28, 2007 2:07 pm

Hi Cosmin,

I realized now that the search actually returns me the path if it was found, thanks for pointing that out;
That said, It only finds the files, if the path that use, is form a pre-defined folder variable (like [CommonFilesFolder] for example.. if I use the [ISAPI] which i'm guessing its generated after I add the folde to the "files &folders" section, it won't find the file no matter what depth I use.

I hope my explanation is clear.

I don't know if there is another settng that needs to be done?
Thanks,
Marcelo
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
if I use the [ISAPI] which i'm guessing its generated after I add the folde to the "files &folders" section, it won't find the file no matter what depth I use.

If you are using the property ISAPI with the value C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\ISAPI then you need to set the depth to at least 6.

Please note that for the search you can also use in the "Path" field (in the "Identification" section) the folder [WindowsVolume] with the depth set to 6.

If you are using the result of the search to create a property based folder and the search is not successful, then the property will take a random path because it cannot be empty (most likely the value will be C:\NAME_OF_YOUR_PROPERTY).

You can read more about the search feature here:
http://www.advancedinstaller.com/user-guide/search.html

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”