PDA

View Full Version : Upgrade from 5 to 6 with .NET wrapping of CGI


hessner
12-23-2008, 08:31 PM
Hi,

I use this approace in version 5:

var psi = new ProcessStartInfo {FileName = (MyPath + @"\Win32_search.cgi")};
psi.EnvironmentVariables["REQUEST_METHOD"] = "GET";
psi.EnvironmentVariables["QUERY_STRING"] = paramStr;
psi.RedirectStandardInput = false;
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
var proc = Process.Start(psi);
proc.StandardOutput.ReadLine(); // skip the HTTP header line
var zoom_results = proc.StandardOutput.ReadToEnd(); // read from stdout
proc.WaitForExit();

var enc = proc.StandardOutput.CurrentEncoding;
var output = enc.GetBytes(zoom_results);

Hope this is still valid in version 6.0, but where are: Win32_search.cgi located now?

wrensoft
12-23-2008, 09:02 PM
Yes, this shouold still work.
There are 3 versions of the CGI. One for Windows, Linux and BSD. (and we also have seperate Mac and Sun releases).

When you create a set of index filles, the correct CGI file is copied into the output folder. So the output folder you select is the easiest location to get the CGI file from. However in this case you should be calling search.cgi instead of Win32_search.cgi.

If you want to see all the CGI files, then the installation folder for these files is by default,
On Vista
C:\ProgramData\Wrensoft\Zoom Search Engine Indexer\scripts\CGI

On XP
C:\Documents and Settings\All Users\Application Data\Wrensoft\Zoom Search Engine Indexer\scripts\CGI

Note that for some reason we don't really understand Vista hides the ProgramData folder. But this is where Microsoft recomends files like this are stored.

hessner
12-29-2008, 01:13 AM
I use this code to activate the indexer from my aspx page:

var p = new Process
{
StartInfo =
{
WorkingDirectory = MyPath,
FileName = ConfigurationManager.AppSettings["ZoomIndexer"],
Arguments = (" -s " + MyPath + "/zoom.zcfg"),
CreateNoWindow = true,
UseShellExecute = false
}
};
p.Start();
p.WaitForExit();

It work fine, but I get these lines in the bottom of my zoomindexer.log file:

Could not copy search script from: C:\Documents and Settings\All Users\Application Data\Wrensoft\Zoom Search Engine Indexer\scripts\CGI\Win32_search.cgi [Access denied].

Failed to open .ini file (C:\Documents and Settings\All Users\Application Data\Wrensoft\Zoom Search Engine Indexer\zoom.ini)
Failed to open .ini file (C:\Documents and Settings\All Users\Application Data\Wrensoft\Zoom Search Engine Indexer\zoom.ini)
Failed to open .ini file (C:\Documents and Settings\All Users\Application Data\Wrensoft\Zoom Search Engine Indexer\zoom.ini)

1. I don't need the system to copy the Win32_search.cgi file to my folder - how can I stop that?
2. I don't want anything to be written to the zoom.ini file at that location, how do I stop that - or set the system to use the WorkingDirectory path instead?

wrensoft
12-29-2008, 03:45 AM
I assume that the account running your ASPX script doesn't have permissions in those folders.

In the advanced configuration panel you can specify the location of a custom script (in any folder). So this should allow you to avoid the error.

The ini file just holds data related to the Zoom user interface, like the last configuration files used and the position of the Zoom window on the desktop. You can ignore these errors. This is the Microsoft recommended location for files like this.

If you have the enterprise edition, then you can call Zoom in console mode (http://www.wrensoft.com/zoom/support/faq_commandline.html), which should avoid these ini file errors.

hessner
12-30-2008, 12:49 AM
The call, as I inserted in my last thread, is a console mode call.

You can see that I use "-s" in the Arguments,- are there other parameters that should be added to skip the opening of the zoom.ini file?

wrensoft
12-30-2008, 04:25 AM
Console mode (http://www.wrensoft.com/zoom/support/faq_commandline.html) uses the -c flag.
-s is Spider mode.

hessner
12-31-2008, 02:49 PM
Hi,

I have the proffesional version - and have never seen these messages before.

My conclusion is that version 6 is doing things in a different way.

My only choise, as I unterstand it, is to ignore it and leave these messages in the log.

wrensoft
12-31-2008, 08:20 PM
My only choise, as I unterstand it, is to ignore it and leave these messages in the log


No. Your other choice is to change the file permissions to allow this file to be read and written.