2024-09-18 12:15:57 +00:00
|
|
|
# $Id$
|
|
|
|
|
2024-09-19 10:56:38 +00:00
|
|
|
VIFileVersion "1.0.0.0"
|
|
|
|
VIProductVersion "1.0.0.0"
|
2024-09-19 10:54:21 +00:00
|
|
|
VIAddVersionKey "FileVersion" "${VERSION}"
|
|
|
|
VIAddVersionKey "LegalCopyright" "Public domain. Original by Nishi"
|
|
|
|
VIAddVersionKey "FileDescription" "Tewi HTTPd Installer"
|
|
|
|
|
2024-09-18 20:20:36 +00:00
|
|
|
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Japanese.nlf"
|
|
|
|
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
|
|
|
|
|
2024-09-18 12:15:57 +00:00
|
|
|
Name "Tewi HTTPd"
|
|
|
|
OutFile "install.exe"
|
|
|
|
InstallDir "C:\Tewi"
|
2024-09-19 10:42:38 +00:00
|
|
|
Icon "tewi-install.ico"
|
2024-09-18 12:15:57 +00:00
|
|
|
LicenseData ../LICENSE
|
2024-09-18 20:02:26 +00:00
|
|
|
|
2024-09-18 20:20:36 +00:00
|
|
|
LangString EXEC_ONLY ${LANG_ENGLISH} "Install the executable only"
|
|
|
|
LangString EXEC_ONLY ${LANG_JAPANESE} "実行機能のみをインストールする"
|
|
|
|
LangString SERV_TOO ${LANG_ENGLISH} "Install the service too (NT-only)"
|
|
|
|
LangString SERV_TOO ${LANG_JAPANESE} "サービスもインストールする(NTのみ)"
|
|
|
|
LangString WAIT_STOP ${LANG_ENGLISH} "Waiting for 1 second so service can stop"
|
|
|
|
LangString WAIT_STOP ${LANG_JAPANESE} "サービスが止まるのを待っています"
|
|
|
|
|
2024-09-18 20:02:26 +00:00
|
|
|
!include "LogicLib.nsh"
|
|
|
|
!include "Sections.nsh"
|
|
|
|
|
2024-09-18 12:15:57 +00:00
|
|
|
Page license
|
2024-09-18 20:02:26 +00:00
|
|
|
Page components
|
2024-09-18 12:15:57 +00:00
|
|
|
Page instfiles
|
|
|
|
UninstPage uninstConfirm
|
|
|
|
UninstPage instfiles
|
|
|
|
Section
|
|
|
|
CreateDirectory "$INSTDIR\etc"
|
|
|
|
CreateDirectory "$INSTDIR\www"
|
2024-09-18 12:30:33 +00:00
|
|
|
CreateDirectory "$INSTDIR\www\icons"
|
2024-09-18 12:45:02 +00:00
|
|
|
CreateDirectory "$INSTDIR\modules"
|
2024-09-18 12:15:57 +00:00
|
|
|
CreateDirectory "$INSTDIR\bin"
|
2024-09-18 12:45:02 +00:00
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
File /oname=LICENSE.txt "../LICENSE"
|
|
|
|
SetOutPath "$INSTDIR\modules"
|
|
|
|
File "../Module/*.dll"
|
2024-09-18 12:15:57 +00:00
|
|
|
SetOutPath "$INSTDIR\etc"
|
2024-09-18 12:45:02 +00:00
|
|
|
SetOverWrite off
|
|
|
|
File /oname=tewi.conf "../example-win.conf"
|
2024-09-18 12:15:57 +00:00
|
|
|
SetOutPath "$INSTDIR\www"
|
|
|
|
File /oname=index.html "../itworks.html"
|
2024-09-18 12:30:33 +00:00
|
|
|
SetOutPath "$INSTDIR\www\icons"
|
|
|
|
File "../Icons/*.png"
|
2024-09-18 12:45:02 +00:00
|
|
|
SetOverWrite on
|
2024-09-18 12:15:57 +00:00
|
|
|
|
|
|
|
CreateDirectory "$SMPROGRAMS\Tewi HTTPd"
|
2024-09-18 12:45:02 +00:00
|
|
|
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\License.lnk" "$INSTDIR\LICENSE.txt" ""
|
2024-09-18 12:15:57 +00:00
|
|
|
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Start Tewi HTTPd.lnk" "$INSTDIR\bin\tewi.exe" ""
|
|
|
|
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Start Tewi HTTPd (verbose).lnk" "$INSTDIR\bin\tewi.exe" "-v"
|
|
|
|
CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Uninstall Tewi HTTPd.lnk" "$INSTDIR\uninstall.exe" ""
|
|
|
|
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "DisplayName" "Tewi HTTPd"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
|
|
|
|
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
|
|
SectionEnd
|
|
|
|
|
2024-09-18 20:20:36 +00:00
|
|
|
Section "$(EXEC_ONLY)" SEL_EXEC
|
2024-09-18 20:02:26 +00:00
|
|
|
SetOutPath "$INSTDIR\bin"
|
|
|
|
File "../tewi.exe"
|
|
|
|
WriteINIStr $INSTDIR\install.ini uninstall service false
|
|
|
|
SectionEnd
|
|
|
|
|
2024-09-18 20:20:36 +00:00
|
|
|
Section /o "$(SERV_TOO)" SEL_SERVICE
|
2024-09-18 20:02:26 +00:00
|
|
|
WriteINIStr $INSTDIR\install.ini uninstall service true
|
|
|
|
FileOpen $9 $INSTDIR\install.bat w
|
|
|
|
FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
|
|
|
|
FileClose $9
|
|
|
|
nsExec::Exec '"$INSTDIR\install.bat"'
|
|
|
|
Pop $0
|
2024-09-18 20:20:36 +00:00
|
|
|
DetailPrint "$(WAIT_STOP)"
|
2024-09-18 20:02:26 +00:00
|
|
|
Sleep 1000
|
|
|
|
CreateDirectory "$INSTDIR\logs"
|
|
|
|
SetOutPath "$INSTDIR\bin"
|
|
|
|
File "../tewi.exe"
|
|
|
|
File /oname=tewisrv.exe "../tewi-service.exe"
|
|
|
|
FileOpen $9 $INSTDIR\install.bat w
|
|
|
|
FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
|
|
|
|
FileWrite $9 '"$SYSDIR\sc.exe" create "TewiHTTPd" DisplayName= "Tewi HTTPd" binpath= "$INSTDIR\bin\tewisrv.exe" start= "auto"$\r$\n'
|
|
|
|
FileWrite $9 '"$SYSDIR\sc.exe" start "TewiHTTPd"$\r$\n'
|
|
|
|
FileClose $9
|
|
|
|
nsExec::Exec '"$INSTDIR\install.bat"'
|
|
|
|
Pop $0
|
|
|
|
Delete $INSTDIR\install.bat
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Function .onInit
|
|
|
|
StrCpy $1 ${SEL_EXEC}
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function .onSelChange
|
|
|
|
!insertmacro StartRadioButtons $1
|
|
|
|
!insertmacro RadioButton ${SEL_EXEC}
|
|
|
|
!insertmacro RadioButton ${SEL_SERVICE}
|
|
|
|
!insertmacro EndRadioButtons
|
|
|
|
FunctionEnd
|
|
|
|
|
2024-09-18 12:15:57 +00:00
|
|
|
Section "Uninstall"
|
2024-09-18 20:02:26 +00:00
|
|
|
ReadINIStr $8 $INSTDIR\install.ini uninstall service
|
|
|
|
${If} $8 == "true"
|
|
|
|
FileOpen $9 $INSTDIR\uninstall.bat w
|
|
|
|
FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
|
|
|
|
FileClose $9
|
|
|
|
nsExec::Exec '"$INSTDIR\uninstall.bat"'
|
|
|
|
Pop $0
|
|
|
|
FileOpen $9 $INSTDIR\uninstall.bat w
|
2024-09-18 20:20:36 +00:00
|
|
|
DetailPrint "$(WAIT_STOP)"
|
2024-09-18 20:02:26 +00:00
|
|
|
Sleep 1000
|
|
|
|
FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
|
|
|
|
FileClose $9
|
|
|
|
nsExec::Exec '"$INSTDIR\uninstall.bat"'
|
|
|
|
Pop $0
|
|
|
|
Delete $INSTDIR\uninstall.bat
|
|
|
|
${EndIf}
|
|
|
|
|
2024-09-18 12:15:57 +00:00
|
|
|
RMDir /r "$INSTDIR"
|
|
|
|
RMDir /r "$SMPROGRAMS\Tewi HTTPd"
|
|
|
|
|
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd"
|
|
|
|
SectionEnd
|