Index: fossil.nsi
===================================================================
--- fossil.nsi
+++ fossil.nsi
@@ -8,11 +8,11 @@
 
 ; The name of the installer
 Name "Fossil"
 
 ; The file to write
-OutFile "fossil-setup-7c0bd3ee08.exe"
+OutFile "fossil-setup.exe"
 
 ; The default installation directory
 InstallDir $PROGRAMFILES\Fossil
 ; Registry key to check for directory (so if you install again, it will 
 ; overwrite the old one automatically)
@@ -26,11 +26,11 @@
 ; The stuff to install
 Section "Fossil (required)"
   ; Set output path to the installation directory.
   SetOutPath $INSTDIR
   ; Put file there
-  File ".\build\fossil.exe"
+  File ".\fossil.exe"
   ; Write the installation path into the registry
   WriteRegStr HKLM SOFTWARE\Fossil "Install_Dir" "$INSTDIR"
   ; Write the uninstall keys for Windows
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "DisplayName" "Fossil (remove only)"
   WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Fossil" "UninstallString" '"$INSTDIR\uninstall.exe"'

Index: src/makemake.tcl
===================================================================
--- src/makemake.tcl
+++ src/makemake.tcl
@@ -307,30 +307,34 @@
 #
 TCC = gcc -Os -Wall -DFOSSIL_I18N=0 -L$(ZLIBDIR)/lib -I$(ZLIBDIR)/include
 
 # With HTTPS support
 ifdef FOSSIL_ENABLE_SSL
-TCC += -DFOSSIL_ENABLE_SSL=1
+TCC += -static -DFOSSIL_ENABLE_SSL=1
 endif
 
 #### Extra arguments for linking the finished binary.  Fossil needs
 #    to link against the Z-Lib compression library.  There are no
 #    other dependencies.  We sometimes add the -static option here
 #    so that we can build a static executable that will run in a
 #    chroot jail.
 #
 #LIB = -lz -lws2_32
-LIB = -lmingwex -lz -lws2_32
 # OpenSSL:
 ifdef FOSSIL_ENABLE_SSL
-LIB += -lcrypto -lssl
+LIB += -lssl -lcrypto -lgdi32
 endif
+LIB += -lmingwex -lz -lws2_32
 
 #### Tcl shell for use in running the fossil testsuite.  This is only
 #    used for testing.  If you do not run
 #
 TCLSH = tclsh
+
+#### Nullsoft installer makensis location
+#
+MAKENSIS = "c:\Program Files\NSIS\makensis.exe"
 
 #### Include a configuration file that can override any one of these settings.
 #
 -include config.w32
 
@@ -362,10 +366,13 @@
 }
 
 writeln {
 all:	$(OBJDIR) $(APPNAME)
 
+$(OBJDIR)/icon.o:	$(SRCDIR)/../win/icon.rc
+	cp $(SRCDIR)/../win/icon.rc $(OBJDIR)
+	windres $(OBJDIR)/icon.rc -o $(OBJDIR)/icon.o
 
 install:	$(APPNAME)
 	mv $(APPNAME) $(INSTALLDIR)
 
 $(OBJDIR):
@@ -396,12 +403,12 @@
   $(OBJDIR)/sqlite3.o \
   $(OBJDIR)/shell.o \
   $(OBJDIR)/th.o \
   $(OBJDIR)/th_lang.o
 
-$(APPNAME):	$(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
-	$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
+$(APPNAME):	$(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/icon.o
+	$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/icon.o
 
 # This rule prevents make from using its default rules to try build
 # an executable named "manifest" out of the file named "manifest.c"
 #
 $(SRCDIR)/../manifest:	
@@ -411,10 +418,13 @@
 # command.  "del" will not work here because it is not a separate command
 # but a MSDOS-shell builtin.
 #
 clean:	
 	rm -rf $(OBJDIR) $(APPNAME)
+
+setup: $(OBJDIR) $(APPNAME)
+	$(MAKENSIS) ./fossil.nsi
 
 }
 
 set mhargs {}
 foreach s [lsort $src] {

Index: win/Makefile.mingw
===================================================================
--- win/Makefile.mingw
+++ win/Makefile.mingw
@@ -37,30 +37,34 @@
 #
 TCC = gcc -Os -Wall -DFOSSIL_I18N=0 -L$(ZLIBDIR)/lib -I$(ZLIBDIR)/include
 
 # With HTTPS support
 ifdef FOSSIL_ENABLE_SSL
-TCC += -DFOSSIL_ENABLE_SSL=1
+TCC += -static -DFOSSIL_ENABLE_SSL=1
 endif
 
 #### Extra arguments for linking the finished binary.  Fossil needs
 #    to link against the Z-Lib compression library.  There are no
 #    other dependencies.  We sometimes add the -static option here
 #    so that we can build a static executable that will run in a
 #    chroot jail.
 #
 #LIB = -lz -lws2_32
-LIB = -lmingwex -lz -lws2_32
 # OpenSSL:
 ifdef FOSSIL_ENABLE_SSL
-LIB += -lcrypto -lssl
+LIB += -lssl -lcrypto -lgdi32
 endif
+LIB += -lmingwex -lz -lws2_32
 
 #### Tcl shell for use in running the fossil testsuite.  This is only
 #    used for testing.  If you do not run
 #
 TCLSH = tclsh
+
+#### Nullsoft installer makensis location
+#
+MAKENSIS = "c:\Program Files\NSIS\makensis.exe"
 
 #### Include a configuration file that can override any one of these settings.
 #
 -include config.w32
 
@@ -316,10 +320,13 @@
 VERSION     = $(subst /,\\,$(OBJDIR)/version.exe)
 
 
 all:	$(OBJDIR) $(APPNAME)
 
+$(OBJDIR)/icon.o:	$(SRCDIR)/../win/icon.rc
+	cp $(SRCDIR)/../win/icon.rc $(OBJDIR)
+	windres $(OBJDIR)/icon.rc -o $(OBJDIR)/icon.o
 
 install:	$(APPNAME)
 	mv $(APPNAME) $(INSTALLDIR)
 
 $(OBJDIR):
@@ -346,12 +353,12 @@
 $(OBJDIR)/VERSION.h:	$(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest $(VERSION)
 	$(VERSION) $(SRCDIR)/../manifest.uuid $(SRCDIR)/../manifest >$(OBJDIR)/VERSION.h
 
 EXTRAOBJ =  $(OBJDIR)/sqlite3.o  $(OBJDIR)/shell.o  $(OBJDIR)/th.o  $(OBJDIR)/th_lang.o
 
-$(APPNAME):	$(OBJDIR)/headers $(OBJ) $(EXTRAOBJ)
-	$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB)
+$(APPNAME):	$(OBJDIR)/headers $(OBJ) $(EXTRAOBJ) $(OBJDIR)/icon.o
+	$(TCC) -o $(APPNAME) $(OBJ) $(EXTRAOBJ) $(LIB) $(OBJDIR)/icon.o
 
 # This rule prevents make from using its default rules to try build
 # an executable named "manifest" out of the file named "manifest.c"
 #
 $(SRCDIR)/../manifest:	
@@ -361,10 +368,13 @@
 # command.  "del" will not work here because it is not a separate command
 # but a MSDOS-shell builtin.
 #
 clean:	
 	rm -rf $(OBJDIR) $(APPNAME)
+
+setup: $(OBJDIR) $(APPNAME)
+	$(MAKENSIS) ./fossil.nsi
 
 
 $(OBJDIR)/page_index.h: $(TRANS_SRC) $(OBJDIR)/mkindex
 	$(MKINDEX) $(TRANS_SRC) >$@
 $(OBJDIR)/headers:	$(OBJDIR)/page_index.h $(OBJDIR)/makeheaders $(OBJDIR)/VERSION.h

ADDED    win/icon.rc
Index: win/version.c
===================================================================
--- win/version.c
+++ win/version.c
@@ -1,8 +1,8 @@
 /*
 ** This C program exists to do the job that AWK would do for the unix
-** makefile - to extract information from the "mainfest" and "manifest.uuid"
+** makefile - to extract information from the "manifest" and "manifest.uuid"
 ** files for this project in order to generate the "VERSION.h" header file.
 */
 #include <stdio.h>
 #include <string.h>
 

