Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Firebird connection (http://forums.winamp.com/showthread.php?t=269287)

AstraS 10th April 2007 07:49

Firebird connection
 
In my custom page user input connection params (ect connection strig, database pats, login, password)
How can i check it?

kichik 10th April 2007 19:19

You can use an external utility like osql to connect to the database with the supplied parameters.

AstraS 10th April 2007 20:10

thx. But how can i use it ?

kichik 10th April 2007 20:15

Execute it using the parameters given by the user. If it doesn't return an error, you've made a valid connection and the connection parameters are correct.

AstraS 10th April 2007 20:41

thx tvice, but i dont understend how can i use it from my installer :(
(sorry for stupid question)

kichik 10th April 2007 20:47

You can execute it using ExecWait or the nsExec plug-in. Both provide the result. ExecWait in the third parameter and nsExec on the stack.

AstraS 11th April 2007 06:41

thx It is work. But it is new problem, i should use only freeware/open sorce and other not commercial soft, but this util from Microsoft, and i think that it's not free :(

kichik 11th April 2007 19:51

iodbc is licensed under GPL.

kichik 11th April 2007 22:19

There are also a plug-in for this task.

http://nsis.sourceforge.net/NsODBC_plug-in

Comperio 11th April 2007 22:43

AstraS,
Your original question was regarding setting up a Firebird database from NSIS. As Kichik pointed out, you can use a command line utility to do so.

If you look at the Firebird documentation, you will find a tool called gsec, which looks like it should give you what you need. (I have not actually worked with Firebird databases before, but from the description, it seems like it would work.)

From Firebird's website:
Quote:

Firebird comes with a command-line user management tool called gsec. Although its functions can also be performed by a number of third-party GUI utilities, you should at least have a basic knowledge of gsec, since this is the official tool and it's present in every Firebird server installation.

AstraS 12th April 2007 22:19

thx all.
but all of this is not what i want.
i'll try to write it again.
in my installer there are firebird database.
before installation complete, user input login pass and path(to .fdb) file, and installer should check it. If pass login and path is correct the installation complete sucsesfully and if not correct installer somthing to do.
sorry for english

AstraS 12th April 2007 22:25

PS and there are two important things
1. it is should work with Firebird
2. and be freeware or GNU or.....

kichik 13th April 2007 10:34

How is this not what you want? It gives you access to the Firebird database so you can try and connect to it using the details provided by the user. If the connection fails, the credentials are wrong. Aside from osql, which is Microsoft's, everything else mentioned is completely free and Comperio's suggestion is even a part of Firebird itself.

AstraS 13th April 2007 12:23

thx kichik
but my script not work :( and i don't know why.
i check it and all of this methods work whithout my script

Comperio 13th April 2007 13:43

If the methods work outside of the script, then it's probably in the way that you are calling them within your install.

Maybe if you attach a minimal example illustrating the problem, then someone could help get you pointed in the right direction.

AstraS 13th April 2007 17:50

this is my test example

;--------------------------------
;Include Modern UI

!include "MUI.nsh"

XPStyle on
;Name and file
Name "B2 server"
OutFile "Setup.exe"

;Default installation folder
InstallDir "$PROGRAMFILES\B\B2"


!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_INSTFILES

Function CheckDB
ExecWait '"$INSTDIR\gsec.exe" -user sysdba -pass masterkey -database c:\P\B2.fdb' $0
DetailPrint "some program returned $0"
FunctionEnd

;--------------------------------
Section "Main" SecMain

SetOutPath "$INSTDIR"
File "gsec.exe"
call CheckDB
Delete $INSTDIR\gsec.exe
RMDir $INSTDIR
SectionEnd

AstraS 13th April 2007 20:42

help me please!

Comperio 14th April 2007 05:44

Your script seems like it should work. But, are you sure you got your command correct? From the gsec documentation, you are only specifying a few options, but no real command. (in other words, you haven't told it to actually do anything). (By the way, what are you trying to accomplish anyway?)

Does the same command run from a RUN box on the target computer? (You may want to also try it from a command prompt just to see what type of message you may be getting back.)

It might be helpful to read through the Firebird documentation. There's some good info there that may help.

Again, I've never actually used a Firebird database before so this is probably all I can offer you. From what I can tell so far, it looks like you just need to figure out the proper tools. Maybe someone else can give you something more...


All times are GMT. The time now is 04:19.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.