소스 검색

Add support for NSIS installer

Jakob Truelsen 16 년 전
부모
커밋
c8ab5cb879
3개의 변경된 파일79개의 추가작업 그리고 45개의 파일을 삭제
  1. 11 2
      scripts/release.sh
  2. 0 43
      wkhtmltopdf.man.m4
  3. 68 0
      wkhtmltopdf.nsi.m4

+ 11 - 2
scripts/release.sh

@@ -5,7 +5,10 @@ if [[ $1 == "" ]] || [[ $2 == "" ]] || [[ $3 == "" ]]; then
 	echo "Bad version"
 	exit 1
 fi
-v="$1.$2.$3_$4"
+v="$1.$2.$3"
+if [[ "$4" != "" ]]; then
+    v="$v_$4"
+fi
 
 echo "About to release $v" 
 read -p "Are you sure you are ready: " N
@@ -34,6 +37,12 @@ rm -rf "release-$v"
 mkdir "release-$v"
 git checkout-index --prefix="./release-$v/wkhtmltopdf-$v/" -a
 tar -cjvf "release-$v/wkhtmltopdf-$v.tar.bz2" -C "release-$v" "wkhtmltopdf-$v"
-cp wkhtmltopdf.exe "release-$v/wkhtmltopdf-$v.exe"
+cp wkhtmltopdf.exe "release-$v/wkhtmltopdf.exe"
+m4 -D "WKVERSION=$v" wkhtmltopdf.nsi.m4 > "release-$v/wkhtmltopdf.nsi"
 tar -cjvf "release-$v/wkhtmltopdf-$v-static-i386.tar.bz2" wkhtmltopdf-i386
 tar -cjvf "release-$v/wkhtmltopdf-$v-static-amd64.tar.bz2" wkhtmltopdf-amd64
+cd "release-$v"
+for x in libgcc_s_dw2-1.dll ssleay32.dll libeay32.dll EnvVarUpdate.nsh; do
+    [ -f "$x" ] ||  wget http://wkhtmltopdf.googlecode.com/files/$x -O $x
+done
+makensis wkhtmltopdf.nsi 

+ 0 - 43
wkhtmltopdf.man.m4

@@ -1,43 +0,0 @@
-.\" Copyright (C) 1995, 1999, 2000, 2001  Free Software Foundation, Inc.
-.\"
-.\" This file is part of wkhtmltopdf.
-.\"
-.\" wkhtmltopdf is free software; you can redistribute it and/or modify
-.\" it under the terms of the GNU General Public License as published by
-.\" the Free Software Foundation; either version 3, or (at your option)
-.\" any later version.
-.\"
-.\" wkhtmltopdf is distributed in the hope that it will be useful,
-.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
-.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-.\" GNU General Public License for more details.
-.\"
-.\" You should have received a copy of the GNU General Public License
-.\" along with GNU Emacs; see the file COPYING.  If not, write to the
-.\" Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-.\" Boston, MA 02111-1307, USA.
-.\"
-.TH WKHTMLTOPDF 1 "2009 February 23"
-.SH NAME
-
-wkhtmltopdf - convert webpages to pdf
-
-.SH SYNOPSIS
-wkhtmltopdf [OPTIONS]... <input file> [More inputfiles] <output file>
-
-.SH DESCRIPTION
-Converts one or more htmlpage to a pdf document.
-
-.SH OPTIONS
-.PD 0
-esyscmd(`./wkhtmltopdf --help | sed -ne /Options:/,/Proxy:/p | sed -e /Options:/d -e /Proxy/d | sed -re "s/^[ \t]*//" |  sed -re "s/^((-[a-zA-Z], )?--[a-z-]+)[\t ]*(<[a-z]+>)?[ \t]*/.TP\n\\\fB\1\\\fR \\\fI\3\\\fR\n/" | sed -re "s/''/\\\'/g" | sed -re "s/-/\\\\-/g")
-.PD
-.SH PROXY
-.PD 0
-esyscmd(`./wkhtmltopdf --help | sed -ne "/By default proxy/,/<proxy> :=/p" | sed -re "s/^  (.*)/.PP\n\1/" | sed -re "s/-/\\\\-/g"')
-.PD
-.SH BUGS
-Report bugs to <antialize@gmail.com>.
-.SH AUTHORS
-wkhtmltopdf was written by Jakob Truelsen. 
-Patches by esyscmd(`./wkhtmltopdf --version | sed -nre "s/Patches by (.*)/\1/p"')

+ 68 - 0
wkhtmltopdf.nsi.m4

@@ -0,0 +1,68 @@
+!include "MUI2.nsh"
+!include "EnvVarUpdate.nsh"
+
+Name "wkhtmltopdf WKVERSION"
+OutFile "wkhtmltopdf-WKVERSION-installer.exe"
+
+RequestExecutionLevel admin
+
+;Default installation folder
+InstallDir "$PROGRAMFILES\wkhtmltopdf"
+  
+;Get installation folder from registry if available
+InstallDirRegKey HKCU "Software\wkhtmltopdf" ""
+
+;--------------------------------
+;Interface Settings
+
+!define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+	
+!insertmacro MUI_PAGE_LICENSE "../COPYING"
+; !insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+  
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+  
+;--------------------------------
+;Languages
+ 
+  !insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+
+Section
+  SetOutPath "$INSTDIR"
+  file wkhtmltopdf.exe
+  file libgcc_s_dw2-1.dll
+  file ssleay32.dll
+  file libeay32.dll
+  WriteRegStr HKCU "Software\wkhtmltopdf" "" $INSTDIR
+  WriteUninstaller "$INSTDIR\uninstall.exe"
+
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf" \
+                   "DisplayName" "wkhtmltopdf"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf" \
+                   "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
+  ${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR" 
+SectionEnd
+
+
+;--------------------------------
+;Uninstaller Section
+
+Section "Uninstall"
+  Delete "$INSTDIR\wkhtmltopdf.exe"
+  Delete "$INSTDIR\libgcc_s_dw2-1.dll"
+  Delete "$INSTDIR\ssleay32.dll"
+  Delete "$INSTDIR\libeay32.dll"
+
+  Delete "$INSTDIR\uninstall.exe"
+  RMDir "$INSTDIR"
+  DeleteRegKey /ifempty HKCU "Software\wkhtmltopdf"
+SectionEnd