source: Main/trunk/Server/install.nsi@ 68

Last change on this file since 68 was 63, checked in by Nishi, on Sep 19, 2024 at 5:20:36 AM

add japanese to installer

  • Property svn:keywords set to Id
File size: 3.8 KB
RevLine 
[54]1# $Id: install.nsi 63 2024-09-18 20:20:36Z nishi $
2
[63]3LoadLanguageFile "${NSISDIR}\Contrib\Language files\Japanese.nlf"
4LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
5
[54]6Name "Tewi HTTPd"
7OutFile "install.exe"
8InstallDir "C:\Tewi"
9Icon "tewi.ico"
10LicenseData ../LICENSE
[62]11
[63]12LangString EXEC_ONLY ${LANG_ENGLISH} "Install the executable only"
13LangString EXEC_ONLY ${LANG_JAPANESE} "実行機能のみをインストールする"
14LangString SERV_TOO ${LANG_ENGLISH} "Install the service too (NT-only)"
15LangString SERV_TOO ${LANG_JAPANESE} "サービスもインストールする(NTのみ)"
16LangString WAIT_STOP ${LANG_ENGLISH} "Waiting for 1 second so service can stop"
17LangString WAIT_STOP ${LANG_JAPANESE} "サービスが止まるのを待っています"
18
[62]19!include "LogicLib.nsh"
20!include "Sections.nsh"
21
[54]22Page license
[62]23Page components
[54]24Page instfiles
25UninstPage uninstConfirm
26UninstPage instfiles
27Section
28 CreateDirectory "$INSTDIR\etc"
29 CreateDirectory "$INSTDIR\www"
[60]30 CreateDirectory "$INSTDIR\www\icons"
[61]31 CreateDirectory "$INSTDIR\modules"
[54]32 CreateDirectory "$INSTDIR\bin"
[61]33 SetOutPath "$INSTDIR"
34 File /oname=LICENSE.txt "../LICENSE"
35 SetOutPath "$INSTDIR\modules"
36 File "../Module/*.dll"
[54]37 SetOutPath "$INSTDIR\etc"
[61]38 SetOverWrite off
39 File /oname=tewi.conf "../example-win.conf"
[54]40 SetOutPath "$INSTDIR\www"
41 File /oname=index.html "../itworks.html"
[60]42 SetOutPath "$INSTDIR\www\icons"
43 File "../Icons/*.png"
[61]44 SetOverWrite on
[54]45
46 CreateDirectory "$SMPROGRAMS\Tewi HTTPd"
[61]47 CreateShortcut "$SMPROGRAMS\Tewi HTTPd\License.lnk" "$INSTDIR\LICENSE.txt" ""
[54]48 CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Start Tewi HTTPd.lnk" "$INSTDIR\bin\tewi.exe" ""
49 CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Start Tewi HTTPd (verbose).lnk" "$INSTDIR\bin\tewi.exe" "-v"
50 CreateShortcut "$SMPROGRAMS\Tewi HTTPd\Uninstall Tewi HTTPd.lnk" "$INSTDIR\uninstall.exe" ""
51
52 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "DisplayName" "Tewi HTTPd"
53 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"'
54
55 WriteUninstaller "$INSTDIR\uninstall.exe"
56SectionEnd
57
[63]58Section "$(EXEC_ONLY)" SEL_EXEC
[62]59 SetOutPath "$INSTDIR\bin"
60 File "../tewi.exe"
61 WriteINIStr $INSTDIR\install.ini uninstall service false
62SectionEnd
63
[63]64Section /o "$(SERV_TOO)" SEL_SERVICE
[62]65 WriteINIStr $INSTDIR\install.ini uninstall service true
66 FileOpen $9 $INSTDIR\install.bat w
67 FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
68 FileClose $9
69 nsExec::Exec '"$INSTDIR\install.bat"'
70 Pop $0
[63]71 DetailPrint "$(WAIT_STOP)"
[62]72 Sleep 1000
73 CreateDirectory "$INSTDIR\logs"
74 SetOutPath "$INSTDIR\bin"
75 File "../tewi.exe"
76 File /oname=tewisrv.exe "../tewi-service.exe"
77 FileOpen $9 $INSTDIR\install.bat w
78 FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
79 FileWrite $9 '"$SYSDIR\sc.exe" create "TewiHTTPd" DisplayName= "Tewi HTTPd" binpath= "$INSTDIR\bin\tewisrv.exe" start= "auto"$\r$\n'
80 FileWrite $9 '"$SYSDIR\sc.exe" start "TewiHTTPd"$\r$\n'
81 FileClose $9
82 nsExec::Exec '"$INSTDIR\install.bat"'
83 Pop $0
84 Delete $INSTDIR\install.bat
85SectionEnd
86
87Function .onInit
88 StrCpy $1 ${SEL_EXEC}
89FunctionEnd
90
91Function .onSelChange
92 !insertmacro StartRadioButtons $1
93 !insertmacro RadioButton ${SEL_EXEC}
94 !insertmacro RadioButton ${SEL_SERVICE}
95 !insertmacro EndRadioButtons
96FunctionEnd
97
[54]98Section "Uninstall"
[62]99 ReadINIStr $8 $INSTDIR\install.ini uninstall service
100 ${If} $8 == "true"
101 FileOpen $9 $INSTDIR\uninstall.bat w
102 FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
103 FileClose $9
104 nsExec::Exec '"$INSTDIR\uninstall.bat"'
105 Pop $0
106 FileOpen $9 $INSTDIR\uninstall.bat w
[63]107 DetailPrint "$(WAIT_STOP)"
[62]108 Sleep 1000
109 FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
110 FileClose $9
111 nsExec::Exec '"$INSTDIR\uninstall.bat"'
112 Pop $0
113 Delete $INSTDIR\uninstall.bat
114 ${EndIf}
115
[54]116 RMDir /r "$INSTDIR"
117 RMDir /r "$SMPROGRAMS\Tewi HTTPd"
118
119 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd"
120SectionEnd
Note: See TracBrowser for help on using the repository browser.