EXEC = .exe
LIB = .dll
PREOBJS = tewi.res
+INSTALLER = install.exe
EXEC = .exe
LIB = .dll
PREOBJS = tewi.res
+INSTALLER = install.exe
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
--- /dev/null
+# $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
--- /dev/null
+# $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
--- /dev/null
+<!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>