From f0880762a2e30b6cdbac85b0a045d625937a4852 Mon Sep 17 00:00:00 2001 From: Raphael Assenat Date: Thu, 21 Jan 2016 23:05:59 -0500 Subject: [PATCH 1/2] Generate a windows installer --- tools/Makefile | 7 ++- tools/gcn64ctl.nsi | 96 +++++++++++++++++++++++++++++++++++++ tools/installers/.gitignore | 1 + 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 tools/gcn64ctl.nsi create mode 100644 tools/installers/.gitignore diff --git a/tools/Makefile b/tools/Makefile index ad97401..c7c85e1 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,5 +1,6 @@ CC=gcc LD=$(CC) +VERSION=1.0 UNAME := $(shell uname -s) ifeq ($(UNAME), Linux) @@ -13,6 +14,7 @@ ifeq ($(shell uname -o), Msys) COMPAT_OBJS=sleep.o memmem.o strcasestr.o app.o PLATFORM_CFLAGS=-DWINDOWS EXTRA_LDFLAGS=-mwindows # uncomment for console output +MAKENSIS=/c/Program\ Files\ \(x86\)/NSIS/makensis endif CFLAGS=-Wall -g `pkg-config $(HIDAPI_NAME) --cflags` --std=c99 $(PLATFORM_CFLAGS) @@ -76,6 +78,9 @@ install: @echo "Install not done yet. Sorry" release_windows: - cp *.exe release_windows + cp $(addsuffix .exe,$(PROGS)) release_windows cp gui.xml release_windows cp project_image.png release_windows + $(MAKENSIS) //DVERSION=$(VERSION) gcn64ctl.nsi + ls installers + @echo "Done" diff --git a/tools/gcn64ctl.nsi b/tools/gcn64ctl.nsi new file mode 100644 index 0000000..bf6d4dc --- /dev/null +++ b/tools/gcn64ctl.nsi @@ -0,0 +1,96 @@ +; example2.nsi +; +; This script is based on example1.nsi, but it remember the directory, +; has uninstall support and (optionally) installs start menu shortcuts. +; +; It will install example2.nsi into a directory that the user selects, + +;-------------------------------- + +; The name of the installer +Name "gcn64ctl" + +; The file to write +OutFile "installers/gcn64ctl-install-${VERSION}.exe" + +; The default installation directory +InstallDir $PROGRAMFILES\gcn64ctl + +; Registry key to check for directory (so if you install again, it will +; overwrite the old one automatically) +InstallDirRegKey HKLM "Software\gcn64ctl" "Install_Dir" + +LicenseData ../LICENSE + +; Request application privileges for Windows Vista +RequestExecutionLevel admin + +;-------------------------------- +!include "LogicLib.nsh" +!include "x64.nsh" + +; Pages + +Page license +Page components +Page directory +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +;-------------------------------- + +; The stuff to install +Section "gcn64ctl (required)" + + SectionIn RO + + ; Set output path to the installation directory. + SetOutPath $INSTDIR + + ; Put file there + File /r "release_windows\*.*" + + ; Write the installation path into the registry + WriteRegStr HKLM SOFTWARE\gcn64ctl "Install_Dir" "$INSTDIR" + + ; Write the uninstall keys for Windows + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gcn64ctl" "DisplayName" "gcn64ctl" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gcn64ctl" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gcn64ctl" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gcn64ctl" "NoRepair" 1 + WriteUninstaller "uninstall.exe" + +SectionEnd + +; Optional section (can be disabled by the user) +Section "Start Menu Shortcuts" + + CreateDirectory "$SMPROGRAMS\raphnet-tech gcn64ctl" + CreateShortCut "$SMPROGRAMS\raphnet-tech gcn64ctl\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\raphnet-tech gcn64ctl\gcn64ctl.lnk" "$INSTDIR\gcn64ctl_gui.exe" "" "$INSTDIR\gcn64ctl_gui.exe" 0 + +SectionEnd + +;-------------------------------- + +; Uninstaller + +Section "Uninstall" + + ; Remove registry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\gcn64ctl" + DeleteRegKey HKLM SOFTWARE\gcn64ctl + + ; Remove files and uninstaller + Delete "$INSTDIR\*.*" + + ; Remove shortcuts, if any + Delete "$SMPROGRAMS\gcn64ctl\*.*" + + ; Remove directories used + RMDir "$SMPROGRAMS\gcn64ctl" + RMDir "$INSTDIR" + +SectionEnd diff --git a/tools/installers/.gitignore b/tools/installers/.gitignore new file mode 100644 index 0000000..b883f1f --- /dev/null +++ b/tools/installers/.gitignore @@ -0,0 +1 @@ +*.exe From 570301bccabe191c9a3e2a65b00622102264e848 Mon Sep 17 00:00:00 2001 From: Raphael Assenat Date: Thu, 21 Jan 2016 23:28:13 -0500 Subject: [PATCH 2/2] installer tweaks --- tools/gcn64ctl.nsi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/gcn64ctl.nsi b/tools/gcn64ctl.nsi index bf6d4dc..51e1390 100644 --- a/tools/gcn64ctl.nsi +++ b/tools/gcn64ctl.nsi @@ -67,9 +67,10 @@ SectionEnd ; Optional section (can be disabled by the user) Section "Start Menu Shortcuts" - CreateDirectory "$SMPROGRAMS\raphnet-tech gcn64ctl" - CreateShortCut "$SMPROGRAMS\raphnet-tech gcn64ctl\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 - CreateShortCut "$SMPROGRAMS\raphnet-tech gcn64ctl\gcn64ctl.lnk" "$INSTDIR\gcn64ctl_gui.exe" "" "$INSTDIR\gcn64ctl_gui.exe" 0 + CreateDirectory "$SMPROGRAMS\raphnet-tech GC/N64 adapter manager" + CreateShortCut "$SMPROGRAMS\raphnet-tech GC/N64 adapter manager\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\raphnet-tech GC/N64 adapter manager\Commandi-line tools.lnk" "$SYSDIR\cmd.exe" '/K "cd /d $INSTDIR"' "$SYSDIR\cmd.exe" 0 + CreateShortCut "$SMPROGRAMS\raphnet-tech GC/N64 adapter manager\GC/N64 adapter manager.lnk" "$INSTDIR\gcn64ctl_gui.exe" "" "$INSTDIR\gcn64ctl_gui.exe" 0 SectionEnd @@ -87,7 +88,7 @@ Section "Uninstall" Delete "$INSTDIR\*.*" ; Remove shortcuts, if any - Delete "$SMPROGRAMS\gcn64ctl\*.*" + Delete "$SMPROGRAMS\raphnet-tech GC/N64 adapter manager\*.*" ; Remove directories used RMDir "$SMPROGRAMS\gcn64ctl"