Changeset 62 in Main for trunk/Server/install.nsi
- Timestamp:
- Sep 19, 2024, 5:02:26 AM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/install.nsi
r61 r62 6 6 Icon "tewi.ico" 7 7 LicenseData ../LICENSE 8 9 !include "LogicLib.nsh" 10 !include "Sections.nsh" 11 8 12 Page license 13 Page components 9 14 Page instfiles 10 15 UninstPage uninstConfirm … … 18 23 SetOutPath "$INSTDIR" 19 24 File /oname=LICENSE.txt "../LICENSE" 20 SetOutPath "$INSTDIR\bin"21 File "tewi.exe"22 25 SetOutPath "$INSTDIR\modules" 23 26 File "../Module/*.dll" … … 43 46 SectionEnd 44 47 48 Section "Install the executable only" SEL_EXEC 49 SetOutPath "$INSTDIR\bin" 50 File "../tewi.exe" 51 WriteINIStr $INSTDIR\install.ini uninstall service false 52 SectionEnd 53 54 Section /o "Install the service too (NT-only)" SEL_SERVICE 55 WriteINIStr $INSTDIR\install.ini uninstall service true 56 FileOpen $9 $INSTDIR\install.bat w 57 FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n' 58 FileClose $9 59 nsExec::Exec '"$INSTDIR\install.bat"' 60 Pop $0 61 DetailPrint "Waiting for 1s so service can stop..." 62 Sleep 1000 63 CreateDirectory "$INSTDIR\logs" 64 SetOutPath "$INSTDIR\bin" 65 File "../tewi.exe" 66 File /oname=tewisrv.exe "../tewi-service.exe" 67 FileOpen $9 $INSTDIR\install.bat w 68 FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n' 69 FileWrite $9 '"$SYSDIR\sc.exe" create "TewiHTTPd" DisplayName= "Tewi HTTPd" binpath= "$INSTDIR\bin\tewisrv.exe" start= "auto"$\r$\n' 70 FileWrite $9 '"$SYSDIR\sc.exe" start "TewiHTTPd"$\r$\n' 71 FileClose $9 72 nsExec::Exec '"$INSTDIR\install.bat"' 73 Pop $0 74 Delete $INSTDIR\install.bat 75 SectionEnd 76 77 Function .onInit 78 StrCpy $1 ${SEL_EXEC} 79 FunctionEnd 80 81 Function .onSelChange 82 !insertmacro StartRadioButtons $1 83 !insertmacro RadioButton ${SEL_EXEC} 84 !insertmacro RadioButton ${SEL_SERVICE} 85 !insertmacro EndRadioButtons 86 FunctionEnd 87 45 88 Section "Uninstall" 89 ReadINIStr $8 $INSTDIR\install.ini uninstall service 90 ${If} $8 == "true" 91 FileOpen $9 $INSTDIR\uninstall.bat w 92 FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n' 93 FileClose $9 94 nsExec::Exec '"$INSTDIR\uninstall.bat"' 95 Pop $0 96 FileOpen $9 $INSTDIR\uninstall.bat w 97 DetailPrint "Waiting for 1s so service can stop..." 98 Sleep 1000 99 FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n' 100 FileClose $9 101 nsExec::Exec '"$INSTDIR\uninstall.bat"' 102 Pop $0 103 Delete $INSTDIR\uninstall.bat 104 ${EndIf} 105 46 106 RMDir /r "$INSTDIR" 47 107 RMDir /r "$SMPROGRAMS\Tewi HTTPd"
Note:
See TracChangeset
for help on using the changeset viewer.