-
Notifications
You must be signed in to change notification settings - Fork 1
/
MSSQL_OLEDBTest.nsi
136 lines (119 loc) · 2.8 KB
/
MSSQL_OLEDBTest.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
; Script generated by the HM NIS Edit Script Wizard.
SetCompressor /SOLID lzma
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "MSSSQL_OLEDBTest"
!define PRODUCT_VERSION "1.40"
!define PRODUCT_PUBLISHER "Multimedia Point Srl"
!define PRODUCT_WEB_SITE "http://www.mmpoint.it"
!define SOURCE_PATH ""
!include "Library.nsh"
!include "sections.nsh"
; MUI 1.67 compatible ------
!include "MUI.nsh"
!include "OLEDB.NSH"
var SQLSERVER
var SQLUSER
var SQLPASSWORD
var SQLQUERY
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "MSSSQL_OLEDBTest.exe"
ShowInstDetails show
; MUI Settings
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
PageEx custom
PageCallBacks ParamC ParamL
PageExEnd
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
!insertmacro MUI_LANGUAGE "English"
Function .onInit
InitPluginsDir
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "SQLDialog.ini"
FunctionEnd
Section ""
setoutpath $PLUGINSDIR
;FILE testu.sql
FILE test.sql
detailprint "Loggin on to SQL server $SQLSERVER"
${OLEDB}::SQL_Logon "$SQLSERVER" "$SQLUSER" "$SQLPASSWORD"
pop $0
detailprint $0
pop $0
detailprint $0
${OLEDB}::SQL_GetError
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_Execute "$SQLQUERY"
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetError
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetRow
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetRow
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetError
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_ExecuteScript "$PLUGINSDIR\test.sql"
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetError
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetRow
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetRow
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_GetError
Pop $0
DetailPrint $0
Pop $0
DetailPrint $0
${OLEDB}::SQL_Logout
SectionEnd
Function ParamC
!insertmacro MUI_HEADER_TEXT "SQL Parameters" "Insert SQL Parameters"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "SQLDialog.ini"
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
; ParamC
Function ParamL
!insertmacro MUI_INSTALLOPTIONS_READ $SQLSERVER "SQLDialog.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SQLUSER "SQLDialog.ini" "Field 4" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SQLPASSWORD "SQLDialog.ini" "Field 6" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $SQLQUERY "SQLDialog.ini" "Field 7" "State"
; Controllo i parametri
FunctionEnd
;ParamL