Advertisement
Guest User

Untitled

a guest
Mar 11th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ;#################################
  3.     !include "UMUI.nsh" # Modern UI version 2
  4.     !include "x64.nsh" # x64 specific commands
  5.     !include "LogicLib.nsh" #LogicLib
  6.    
  7.     !define APPNAME "TESTAPP"
  8.     !define COMPANYNAME "TESTCOMPANY"
  9.    
  10.    
  11.     ; Define the full name of the program
  12.     Name "${APPNAME}"
  13.    
  14. ; Define the installation directory
  15.     InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}"
  16.  
  17. ; The name of the file to write when you compile this script
  18.     OutFile "${APPNAME}x64.exe"
  19.  
  20. ;#################################
  21. ;General
  22. ;#################################
  23.  
  24.     RequestExecutionLevel admin
  25.    
  26.     SetFont "Comic Sans MS" 8
  27.    
  28.     !define UMUI_SKIN "blue"
  29.    
  30. ######################################
  31. ;Pages
  32. ######################################
  33.    
  34.     !insertmacro MUI_PAGE_COMPONENTS
  35.     !insertmacro MUI_PAGE_DIRECTORY
  36.     !insertmacro MUI_PAGE_INSTFILES
  37.  
  38.    
  39.     !insertmacro MUI_UNPAGE_CONFIRM
  40.     !insertmacro MUI_UNPAGE_INSTFILES
  41.  
  42.     !insertmacro MUI_LANGUAGE "English"
  43.  
  44. ######################################
  45. ;Sections
  46. ######################################
  47.  
  48. Section "ODBC" SecODBC
  49.  
  50.    
  51.     ExecWait '"C:\Windows\System32\odbcconf.exe" CONFIGSYSDSN "iSeries Access ODBC Driver" "DSN=TEST DSN ENTRY|System=${Server_State}|DefaultLibraries=${Company_State}DATA|SSL=0|Description=TEST ODBC ENTRY|QueryTimeout=0"'
  52.    
  53. SectionEnd
  54.  
  55.     !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  56.     !insertmacro MUI_DESCRIPTION_TEXT ${SecODBC} $(DESC_SecODBC)
  57.     !insertmacro MUI_FUNCTION_DESCRIPTION_END  
  58.    
  59.     ; Language strings for ODBC Section
  60.     LangString DESC_SecODBC ${LANG_ENGLISH} "This will install the ODBC iSeries for Windows."  
  61.  
  62.  
  63. ;#################################
  64. ;Functions
  65. ;#################################
  66.  
  67. Function .onInit
  68.    
  69.     Var /GLOBAL Server_State
  70.     Var /GLOBAL Company_State
  71.    
  72.     readINIStr $0 "$EXEDIR\setup.ini" Settings Server
  73.    
  74.     readINIStr $1 "$EXEDIR\setup.ini" Settings Company
  75.    
  76.     StrCpy $Server_State $0
  77.    
  78.     StrCpy $Company_State $1
  79.    
  80.     MessageBox MB_OK $Server_State
  81.    
  82.     MessageBox MB_OK $Company_State
  83.    
  84. FunctionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement