diff options
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | nsis/installer.nsi.in | 35 |
2 files changed, 30 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 72d7df2..2b079f5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,6 @@ AC_INIT([terminal-media-launcher],[0.2]) AC_SUBST([PACKAGE_TITLE], ["Terminal Media Launcher"]) +AC_SUBST([NSIS_PRODUCT_VERSION], ["$PACKAGE_VERSION.0.0"]) AC_CONFIG_SRCDIR([src/draw.c]) AC_CONFIG_HEADERS([config.h]) diff --git a/nsis/installer.nsi.in b/nsis/installer.nsi.in index 18a52af..066d4a9 100644 --- a/nsis/installer.nsi.in +++ b/nsis/installer.nsi.in @@ -10,15 +10,15 @@ !define PRODUCT_NAME "@PACKAGE_TITLE@" !define PRODUCT_DESCRIPTION "TODO" !define COPYRIGHT "GNU GPLv3" -!define PRODUCT_VERSION "@PACKAGE_VERSION@.0.0" +!define PRODUCT_VERSION "@NSIS_PRODUCT_VERSION@" !define SETUP_VERSION 1.0.0.0 ;------------------------------------------------------------------------------- ; Attributes -Name "@PACKAGE_NAME@" -OutFile "@PACKAGE_NAME@-Setup.exe" -InstallDir "$PROGRAMFILES\@PACKAGE_TITLE@" -InstallDirRegKey HKCU "Software\Louie S\@PACKAGE_TITLE@" "" +Name "${PRODUCT_NAME}" +OutFile "${PRODUCT_NAME} @PACKAGE_VERSION@ Setup.exe" +InstallDir "$PROGRAMFILES\${PRODUCT_NAME}" +InstallDirRegKey HKCU "Software\Louie S\${PRODUCT_NAME}" "" RequestExecutionLevel user ; user|highest|admin ;------------------------------------------------------------------------------- @@ -33,10 +33,17 @@ VIAddVersionKey "FileVersion" "${SETUP_VERSION}" ;------------------------------------------------------------------------------- ; Modern UI Appearance ;!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" +!define MUI_ICON "..\src\icon\@PACKAGE_NAME@.ico" +!define MUI_UNIICON "..\src\icon\@PACKAGE_NAME@.ico" !define MUI_HEADERIMAGE ;!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp" ;!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp" !define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_FINISHPAGE_RUN "@PACKAGE_NAME@.exe" +!define MUI_FINISHPAGE_SHOWREADME "" +!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED +!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut" +!define MUI_FINISHPAGE_SHOWREADME_FUNCTION installDesktopShortcut ;------------------------------------------------------------------------------- ; Installer Pages @@ -44,6 +51,8 @@ VIAddVersionKey "FileVersion" "${SETUP_VERSION}" !insertmacro MUI_PAGE_LICENSE "..\COPYING" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY +Var StartMenuFolder +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH @@ -64,16 +73,30 @@ Section "My Application" MyApp SetOutPath $INSTDIR File "..\src\@PACKAGE_NAME@.exe" File "deps\*.*" - ;File "Readme.txt" + ;File "Readme.txt" ; TODO + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + CreateDirectory "$SMPROGRAMS\$StartMenuFolder\" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_NAME}.lnk" "$INSTDIR\@PACKAGE_NAME@.exe" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + !insertmacro MUI_STARTMENU_WRITE_END WriteUninstaller "$INSTDIR\Uninstall.exe" SectionEnd +Function installDesktopShortcut + CreateShortCut "$Desktop\${PRODUCT_NAME}.lnk" "$INSTDIR\@PACKAGE_NAME@.exe" +FunctionEnd + ;------------------------------------------------------------------------------- ; Uninstaller Sections Section "Uninstall" Delete "$INSTDIR\@PACKAGE_NAME@.exe" Delete "$INSTDIR\*.dll" Delete "$INSTDIR\Uninstall.exe" + Delete "$Desktop\${PRODUCT_NAME}.lnk" + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder + Delete "$SMPROGRAMS\$StartMenuFolder\${PRODUCT_NAME}.lnk" + Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" + RMDir "$SMPROGRAMS\$StartMenuFolder" RMDir "$INSTDIR" ;DeleteRegKey /ifempty HKCU "Software\Modern UI Test" SectionEnd |