Subversion Repositories Tewi

Rev

Rev 62 | Rev 76 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 62 Rev 63
Line 1... Line 1...
1
# $Id: install.nsi 62 2024-09-18 20:02:26Z nishi $
1
# $Id: install.nsi 63 2024-09-18 20:20:36Z nishi $
-
 
2
 
-
 
3
LoadLanguageFile "${NSISDIR}\Contrib\Language files\Japanese.nlf"
-
 
4
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
2
 
5
 
3
Name "Tewi HTTPd"
6
Name "Tewi HTTPd"
4
OutFile "install.exe"
7
OutFile "install.exe"
5
InstallDir "C:\Tewi"
8
InstallDir "C:\Tewi"
6
Icon "tewi.ico"
9
Icon "tewi.ico"
7
LicenseData ../LICENSE
10
LicenseData ../LICENSE
8
 
11
 
-
 
12
LangString EXEC_ONLY ${LANG_ENGLISH} "Install the executable only"
-
 
13
LangString EXEC_ONLY ${LANG_JAPANESE} "実行機能のみをインストールする"
-
 
14
LangString SERV_TOO ${LANG_ENGLISH} "Install the service too (NT-only)"
-
 
15
LangString SERV_TOO ${LANG_JAPANESE} "サービスもインストールする(NTのみ)"
-
 
16
LangString WAIT_STOP ${LANG_ENGLISH} "Waiting for 1 second so service can stop"
-
 
17
LangString WAIT_STOP ${LANG_JAPANESE} "サービスが止まるのを待っています"
-
 
18
 
9
!include "LogicLib.nsh"
19
!include "LogicLib.nsh"
10
!include "Sections.nsh"
20
!include "Sections.nsh"
11
 
21
 
12
Page license
22
Page license
13
Page components
23
Page components
Line 43... Line 53...
43
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"'
53
	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd" "UninstallString" '"$INSTDIR\uninstall.exe"'
44
 
54
 
45
	WriteUninstaller "$INSTDIR\uninstall.exe"
55
	WriteUninstaller "$INSTDIR\uninstall.exe"
46
SectionEnd
56
SectionEnd
47
 
57
 
48
Section "Install the executable only" SEL_EXEC
58
Section "$(EXEC_ONLY)" SEL_EXEC
49
	SetOutPath "$INSTDIR\bin"
59
	SetOutPath "$INSTDIR\bin"
50
	File "../tewi.exe"
60
	File "../tewi.exe"
51
	WriteINIStr $INSTDIR\install.ini uninstall service false
61
	WriteINIStr $INSTDIR\install.ini uninstall service false
52
SectionEnd
62
SectionEnd
53
 
63
 
54
Section /o "Install the service too (NT-only)" SEL_SERVICE
64
Section /o "$(SERV_TOO)" SEL_SERVICE
55
	WriteINIStr $INSTDIR\install.ini uninstall service true
65
	WriteINIStr $INSTDIR\install.ini uninstall service true
56
	FileOpen $9 $INSTDIR\install.bat w
66
	FileOpen $9 $INSTDIR\install.bat w
57
	FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
67
	FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
58
	FileClose $9
68
	FileClose $9
59
	nsExec::Exec '"$INSTDIR\install.bat"'
69
	nsExec::Exec '"$INSTDIR\install.bat"'
60
	Pop $0
70
	Pop $0
61
	DetailPrint "Waiting for 1s so service can stop..."
71
	DetailPrint "$(WAIT_STOP)"
62
	Sleep 1000
72
	Sleep 1000
63
	CreateDirectory "$INSTDIR\logs"
73
	CreateDirectory "$INSTDIR\logs"
64
	SetOutPath "$INSTDIR\bin"
74
	SetOutPath "$INSTDIR\bin"
65
	File "../tewi.exe"
75
	File "../tewi.exe"
66
	File /oname=tewisrv.exe "../tewi-service.exe"
76
	File /oname=tewisrv.exe "../tewi-service.exe"
Line 92... Line 102...
92
		FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
102
		FileWrite $9 '"$SYSDIR\sc.exe" stop "TewiHTTPd"$\r$\n'
93
		FileClose $9
103
		FileClose $9
94
		nsExec::Exec '"$INSTDIR\uninstall.bat"'
104
		nsExec::Exec '"$INSTDIR\uninstall.bat"'
95
		Pop $0
105
		Pop $0
96
		FileOpen $9 $INSTDIR\uninstall.bat w
106
		FileOpen $9 $INSTDIR\uninstall.bat w
97
		DetailPrint "Waiting for 1s so service can stop..."
107
		DetailPrint "$(WAIT_STOP)"
98
		Sleep 1000
108
		Sleep 1000
99
		FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
109
		FileWrite $9 '"$SYSDIR\sc.exe" delete "TewiHTTPd"$\r$\n'
100
		FileClose $9
110
		FileClose $9
101
		nsExec::Exec '"$INSTDIR\uninstall.bat"'
111
		nsExec::Exec '"$INSTDIR\uninstall.bat"'
102
		Pop $0
112
		Pop $0