Old 28th November 2011, 07:58   #1
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
sqlite with nsis

Do you know some plugin for work with sqlite DB?
NOCaut is offline   Reply With Quote
Old 28th November 2011, 10:02   #2
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
I do not know of any SQLite plugin so I just use the SQLite command-line utilities (sqlite.exe and sqlite3.exe) with my installers.
pengyou is offline   Reply With Quote
Old 28th November 2011, 11:28   #3
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
please show me how you oped database and send request?
NOCaut is offline   Reply With Quote
Old 28th November 2011, 12:15   #4
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 571
The SQLite site has a page which explains how to use the "Command Line Shell For SQLite":
http://sqlite.org/sqlite.html

I used the nsExec plugin to call the utility. My installer has to cope with SQLite 2.x and 3.x format databases so I have to examine the first few bytes of the database file to find out which of the two utilities (sqlite.exe or sqlite3.exe) needs to be used.

SQLite 3.x databases start with a "SQLite format 3" header and old 2.x databases have a "** This file contains an SQLite 2.1 database **" header (see http://sqlite.org/fileformat2.html for details of the file format)
pengyou is offline   Reply With Quote
Old 28th November 2011, 14:50   #5
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
not understand
please show simple query
NOCaut is offline   Reply With Quote
Old 28th November 2011, 16:03   #6
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
We are not here to teach you how to use SQLite. Pengyou has already pointed you at the place where you can find the information you need. Please do not ask us to write your installer for you.
MSG is offline   Reply With Quote
Old 28th November 2011, 16:12   #7
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
yes i dont know how to use SQLitei from cmd.exe
ok thanks for help
NOCaut is offline   Reply With Quote
Old 29th November 2011, 09:41   #8
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
nsExec plugin return error when i run example source fro plugin
code error: ???
NOCaut is offline   Reply With Quote
Old 29th November 2011, 09:50   #9
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
How run two command in one cmd line?

c:\sqlite3.exe "test.db"
"UPDATE meta SET value=222 WHERE Key='Provider ID'"
NOCaut is offline   Reply With Quote
Old 29th November 2011, 11:05   #10
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
question resolved - c:\sqlite3.exe "Web Data" < my.sql
NOCaut is offline   Reply With Quote
Old 30th November 2011, 06:58   #11
NOCaut
Senior Member
 
Join Date: Sep 2011
Posts: 106
Quote:
StrCpy $1 "E:\"
SetOutPath $1
File /oname=sqlite3.exe "SQL\sqlite3.exe"
File /oname=update.sql "SQL\update.sql"

nsExec::Exec 'sqlite3.exe "WebData.db" < update.sql'

StrCpy $2 '"WebData.db" < update.sql'
!insertmacro UAC_AsUser_ExecShell "open" "sqlite3.exe" "$2" "" SW_SHOWNORMAL

ExecWait 'sqlite3.exe "WebData.db" < update.sql'
i run sql script use cmd but can`t run use nsis functions.
NOCaut is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump