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..51e1390 --- /dev/null +++ b/tools/gcn64ctl.nsi @@ -0,0 +1,97 @@ +; 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 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 + +;-------------------------------- + +; 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\raphnet-tech GC/N64 adapter manager\*.*" + + ; 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