!include "MUI.nsh" !define APPNAME "MystiQ" !define VERSION "@MYSTIQ_VERSION@" !define DESCRIPTION "A cross platform media converter GUI" !define UNINSTALLER "uninstall.exe" !define LICENSE "license.txt" !define CHANGELOG "changelog.txt" Name "${APPNAME}" OutFile "mystiq_${VERSION}-setup.exe" InstallDir $PROGRAMFILES\MystiQ RequestExecutionLevel admin var StartMenuFolder !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MystiQ" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !define MUI_FINISHPAGE_RUN !define MUI_FINISHPAGE_RUN_NOTCHECKED !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProgram" !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\${CHANGELOG} !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;Languages !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "Italian" !insertmacro MUI_LANGUAGE "French" !insertmacro MUI_LANGUAGE "German" !insertmacro MUI_LANGUAGE "Spanish" Section SetOutPath $INSTDIR # Program Files File mystiq.exe File presets.xml File constants.xml File *.dll File ${LICENSE} file ${CHANGELOG} CreateDirectory translations CreateDirectory tools SetOutPath $INSTDIR\translations File translations\*.qm SetOutPath $INSTDIR\tools File tools\* # Create Uninstaller WriteUninstaller "$INSTDIR\${UNINSTALLER}" # Create Desktop Shortcut CreateShortcut "$DESKTOP\MystiQ.lnk" "$INSTDIR\mystiq.exe" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application # Start Menu Shortcuts CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateShortcut "$SMPROGRAMS\$StartMenuFolder\MystiQ.lnk" "$INSTDIR\mystiq.exe" CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall MystiQ.lnk" "$INSTDIR\${UNINSTALLER}" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Function LaunchProgram ExecShell "" "$INSTDIR\mystiq.exe" FunctionEnd # Uninstaller Section "un.Uninstaller" Delete $INSTDIR\${UNINSTALLER} Delete $INSTDIR\mystiq.exe Delete $INSTDIR\presets.xml Delete $INSTDIR\constants.xml Delete $INSTDIR\*.dll Delete $INSTDIR\${LICENSE} Delete $INSTDIR\${CHANGELOG} Delete $INSTDIR\tools\* RmDir $INSTDIR\tools Delete $INSTDIR\translations\* RmDir $INSTDIR\translations RmDir $INSTDIR # Remove the installation directory if it's empty. Delete "$DESKTOP\MystiQ.lnk" !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk" RmDir "$SMPROGRAMS\$StartMenuFolder" DeleteRegKey /ifempty HKLM "Software\MystiQ" SectionEnd