]> Git repositories of Nishi - tewi.git/commitdiff
installer kinda works
authorNishi <nishi@nishi.boats>
Wed, 18 Sep 2024 12:15:57 +0000 (12:15 +0000)
committerNishi <nishi@nishi.boats>
Wed, 18 Sep 2024 12:15:57 +0000 (12:15 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@54 8739d7e6-ffea-ec47-b151-bdff447c6205

Platform/win32.mk
Platform/win64.mk
Server/Makefile
Server/install.nsi [new file with mode: 0644]
example-win.conf [new file with mode: 0644]
itworks.html [new file with mode: 0644]

index d40fb64d38e8f7996f67b910063fc1271516390c..e5109e4197f5534cfba8a6fc6eb013f0cba4f608 100644 (file)
@@ -11,3 +11,4 @@ LIBS = -lws2_32
 EXEC = .exe
 LIB = .dll
 PREOBJS = tewi.res
+INSTALLER = install.exe
index 187462ad4283eb5d51ecd5793146711bdb941efd..a9c745637690f17b0531969667281ae2e5de6d12 100644 (file)
@@ -11,3 +11,4 @@ LIBS = -lws2_32
 EXEC = .exe
 LIB = .dll
 PREOBJS = tewi.res
+INSTALLER = install.exe
index c746f1d415a32f2f505d05a3380a251559039a34..01bc1514a39af17b60d4d94d239b9a66782843d0 100644 (file)
@@ -7,7 +7,10 @@ include $(PWD)/Platform/$(PLATFORM).mk
 
 OBJS = version.o main.o config.o server.o http.o module.o strptime.o $(EXTOBJS) $(PREOBJS)
 
-all: tewi$(EXEC)
+all: tewi$(EXEC) $(INSTALLER)
+
+install.exe: tewi$(EXEC) install.nsi
+       makensis install.nsi
 
 tewi$(EXEC): $(OBJS) ../Common/common.a
        $(CC) $(LDFLAGS) $(EXTLDFLAGS) -o $@ $(OBJS) $(EXTLIBS) $(LIBS) ../Common/common.a
diff --git a/Server/install.nsi b/Server/install.nsi
new file mode 100644 (file)
index 0000000..6108d3c
--- /dev/null
@@ -0,0 +1,39 @@
+# $Id$
+
+Name "Tewi HTTPd"
+OutFile "install.exe"
+InstallDir "C:\Tewi"
+Icon "tewi.ico"
+LicenseData ../LICENSE
+Page license
+Page instfiles
+UninstPage uninstConfirm
+UninstPage instfiles
+Section
+       CreateDirectory "$INSTDIR\etc"
+       CreateDirectory "$INSTDIR\www"
+       CreateDirectory "$INSTDIR\bin"
+       SetOutPath "$INSTDIR\bin"
+       File "tewi.exe"
+       SetOutPath "$INSTDIR\etc"
+       File /oname=tewi.conf "../example-win.conf"
+       SetOutPath "$INSTDIR\www"
+       File /oname=index.html "../itworks.html"
+
+       CreateDirectory "$SMPROGRAMS\Tewi HTTPd"
+       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
+
+Section "Uninstall"
+       RMDir /r "$INSTDIR"
+       RMDir /r "$SMPROGRAMS\Tewi HTTPd"
+
+       DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tewi HTTPd"
+SectionEnd
diff --git a/example-win.conf b/example-win.conf
new file mode 100644 (file)
index 0000000..fb58ba8
--- /dev/null
@@ -0,0 +1,29 @@
+# $Id: example.conf 40 2024-09-17 12:31:08Z nishi $
+# This is an example config
+
+Listen 80
+#ListenSSL 443
+
+#SSLKey key.pem
+#SSLCertificate cert.pem
+
+MIMEType all application/octet-stream
+MIMEType .html text/html
+MIMEType .txt text/plain
+MIMEType .png image/png
+
+Icon all /icons/unknown.png
+Icon text/* /icons/text.png
+Icon image/* /icons/image.png
+Icon misc/dir /icons/folder.png
+Icon misc/parent /icons/parent.png
+
+DirectoryIndex index.html
+
+Readme README
+
+DocumentRoot C:/Tewi/www
+
+BeginDirectory C:/Tewi/www
+       Allow all
+EndDirectory
diff --git a/itworks.html b/itworks.html
new file mode 100644 (file)
index 0000000..62a11d3
--- /dev/null
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+<html>
+       <head>
+               <title>It Works</title>
+       </head>
+       <body>
+               <h1>It Works!</h1>
+               <hr>
+               Congratulations - If you can see this page, it means Tewi HTTPd has been configured successfully!
+       </body>
+</html>