Skip to content

Commit

Permalink
Refresh Windows NSIS installer
Browse files Browse the repository at this point in the history
  • Loading branch information
gfarmerfr committed Jan 30, 2017
1 parent 480f820 commit 1371412
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 38 deletions.
8 changes: 7 additions & 1 deletion doc/PACKAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ If you want to run the frozen application you can launch the executable `dist\Ni

##### Building a NSIS installer from the frozen application

Coming soon...
After building the frozen app download the last zip from [NSIS2 version](https://sourceforge.net/projects/nsis/files/NSIS%202/).

Extract it in the `tools\win32-installer` directory.

Then via cmd.exe or Powershell go to `tools\win32-installer` directory and run `nsis-$(version)/makensis.exe nicotine+.nsi`

You should now find a `Nicotine+-$(version).exe` installer in the `tools\win32-installer` directory.
4 changes: 0 additions & 4 deletions doc/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ A list of stuff & things todo (not in any particular order):
* Replace db files (causing many problems) by something easier like json.
* **IN PROGRESS**: Make as much as possible optional dependencies work on Windows.
* **STALLED**: Build the OSX version: I've no Mac.

#### Windows specific goals

* Refresh the NSIS installer.
1 change: 0 additions & 1 deletion files/README
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ win32/modern-wizard.svg

Created by eLvErDe (released under GPLv2+ and upgraded to GPLv3+)

win32/nicotine.ico
win32/nicotine-installer.ico

---
Expand Down
Binary file removed files/win32/nicotine.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion tools/nicotine+-win32.spec
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ added_files = [
# UPnPc static binary
('../files/win32/upnpc', 'files/win32/upnpc'),

# Icon for the resulting Nicotine+.exe file
# Icon for the resulting Nicotine+.exe file and shortcuts
('../files/win32/nicotine-plus-128px.ico', 'files/win32'),

# GTK2 rc file for theming
Expand Down
3 changes: 0 additions & 3 deletions tools/win32-installer/README

This file was deleted.

34 changes: 6 additions & 28 deletions tools/win32-installer/nicotine+.nsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!define PRODUCT_NAME "Nicotine+"
!define PRODUCT_VERSION "1.2.14"
!define PRODUCT_VERSION "1.4.0"
!define PRODUCT_PUBLISHER "Nicotine+ Team"
!define PRODUCT_WEB_SITE "http://www.nicotine-plus.org"
!define PRODUCT_DIR_REGKEY "Software\Nicotine+"
Expand All @@ -23,7 +23,6 @@
!insertmacro MUI_PAGE_LICENSE "..\..\COPYING"
; Validate installation directory
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE ValidateInstDir
!insertmacro MUI_PAGE_DIRECTORY
Page custom ShortCuts
!insertmacro MUI_PAGE_INSTFILES
Expand All @@ -44,19 +43,9 @@ Section "Core" Core
SectionIn RO
SetOverwrite on
SetOutPath "$INSTDIR"
File /r "..\..\dist\"
File /r "..\..\dist\Nicotine+\"
SectionEnd

; This function check if python24.dll exists
Function ValidateInstDir
${If} ${FileExists} "$INSTDIR\python24.dll"
MessageBox MB_OK|MB_ICONEXCLAMATION "The choosen directory contains python24.dll.$\n\
This probably means you are installing over an old Nicotine+ (< 1.2.10) installation. It is not supported.$\n$\n\
Please choose another directory or cancel this setup, uninstall the previous Nicotine+ version and then, install this one again."
Abort
${EndIf}
FunctionEnd

Function ShortCuts
!insertmacro MUI_HEADER_TEXT "Nicotine+ shortcuts" "Please choose where shortctus will be created"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "shortcuts.ini"
Expand All @@ -69,24 +58,13 @@ Section -Post
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
; Let's check if and old config exists and move it to APPDATA if possible
${If} ${FileExists} "$INSTDIR\config"
DetailPrint "Old configuration detected."
${If} ${FileExists} "$APPDATA\nicotine"
DetailPrint "Nicotine+ configuration already exists in APPDATA. Don't move the old one."
${Else}
CreateDirectory "$APPDATA\nicotine"
Rename "$INSTDIR\config" "$APPDATA\nicotine\config"
DetailPrint "Old Nicotine+ configuration moved to current user APPDATA."
${EndIf}
${EndIf}
ReadINIStr $0 "$PLUGINSDIR\shortcuts.ini" "Field 2" "State"
${if} $0 = 1
CreateShortCut "$SMPROGRAMS\Nicotine+.lnk" "$INSTDIR\nicotine.exe"
CreateShortCut "$SMPROGRAMS\Nicotine+.lnk" "$INSTDIR\Nicotine+.exe"
${endif}
ReadINIStr $0 "$PLUGINSDIR\shortcuts.ini" "Field 3" "State"
${if} $0 = 1
CreateShortCut "$DESKTOP\Nicotine+.lnk" "$INSTDIR\nicotine.exe" "" "$INSTDIR\files\win32\nicotine.ico" 0
CreateShortCut "$DESKTOP\Nicotine+.lnk" "$INSTDIR\Nicotine+.exe" "" "$INSTDIR\files\win32\nicotine-plus-128px.ico" 0
${endif}
SectionEnd

Expand All @@ -96,8 +74,8 @@ SectionEnd

Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "shortcuts.ini"
${IfNot} ${AtLeastWin2000}
MessageBox MB_OK|MB_ICONEXCLAMATION "Nicotine+ requires Windows 2000 or later."
${IfNot} ${AtLeastWin7}
MessageBox MB_OK|MB_ICONEXCLAMATION "Nicotine+ requires Windows 7 or later."
Quit
${EndIf}
FunctionEnd
Expand Down

0 comments on commit 1371412

Please sign in to comment.