On 11/27/06, Sai Korada <[EMAIL PROTECTED]> wrote:
>  I've packaged the application along with the required GTK dlls in a zip
> file.
>
>  Created a batch file, which, appends the current gtk\bin path to local
> path and then launch the application.
>
> And the console window, which was opened by the batch file will be
> visible till closed explicitly.
>
> My requirement here is either I shall be in a position to set the path
> through program, hence avoid the .bat requirement or automatically close
> the console was the application is launched.

There are a number of ways to deal with this.

The easiest will be to have your batch file call `start /B
yourprogram.exe` after setting up the environment.  There will be a
console window opened when you launch the batch file and then
immediately closed.

Another relatively easy way is to use an Application Path and then you
can simply run your executable.
http://www.codeguru.com/Cpp/W-P/dll/article.php/c99

Another (probably more elegant) way of doing this is to have a
launcher application that sets up your environment and does any other
prep, then implicitly loads your application (using LoadLibraryEx)
(this is what gaim and GIMP do). See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/setdlldirectory.asp
for more info.

> I tried using getenv() and putenv(), but it is not working as expected.

If you're trying to do this in an executable that depends on GTK+,
then it is too late - unless all of the dependencies are satisfied the
application cannot be run.

-D
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to