andre@51: ; Copyright (C) 2016 by ETH Zürich andre@51: ; Software engineering by Intevation GmbH andre@51: ; andre@51: ; This file is Free Software under the GNU GPL (v>=2) andre@51: ; and comes with ABSOLUTELY NO WARRANTY! andre@51: ; See LICENSE.txt for details. andre@51: andre@51: ; This script creates the installer for renameme it needs the andre@51: ; following definitions to be set when calling makensis: andre@51: ; andre@51: ; productname: Name of the Software as it will show up under installed andre@51: ; Software andre@51: ; version_number: The version of the software andre@51: ; setupname: The name for the result created by this andre@51: ; productname_short: Used for the default folder name and such andre@51: ; size: the expectes size of the installation. andre@51: andre@51: ;-------------------------------- andre@51: ; Includes andre@51: andre@51: !define MULTIUSER_EXECUTIONLEVEL Highest andre@51: !define MULTIUSER_MUI andre@51: !define MULTIUSER_INSTALLMODE_COMMANDLINE andre@51: !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "Software\${productname_short}" andre@51: !define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallMode" andre@51: !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "Software\${productname_short}" andre@51: !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "InstallDir" andre@51: !define MULTIUSER_INSTALLMODE_INSTDIR "${productname}" andre@51: andre@51: !addincludedir "${plugin_dir}" andre@51: andre@51: !include "MultiUser.nsh" andre@51: !include "MUI2.nsh" andre@51: !include "FileFunc.nsh" andre@51: andre@51: ;-------------------------------- andre@51: ;Version Information (for installer file properties) andre@51: andre@51: ;VIProductVersion "${version_number}" ;needs integer format: x.x.x.x andre@51: VIProductVersion ${numeric_version} andre@51: VIAddVersionKey "ProductName" "${productname_short}" andre@51: VIAddVersionKey "Comments" "${productname_short} ist Freie Software" andre@51: VIAddVersionKey "CompanyName" "Intevation GmbH" andre@51: VIAddVersionKey "LegalTrademarks" "" andre@51: VIAddVersionKey "LegalCopyright" "Copyright (C) 2016 by ETH Zürich" andre@51: VIAddVersionKey "FileDescription" "Converter for EduApp export files" andre@51: VIAddVersionKey "FileVersion" "${version_number}" andre@51: andre@51: ;-------------------------------- andre@51: ; General andre@51: andre@51: ; Define Name, File and Installdir of Installer andre@51: Name "${productname}" andre@51: OutFile "${setupname}" andre@51: InstallDir "$PROGRAMFILES\${productname}" andre@51: BrandingText "ETH Zürich - ${productname}" andre@51: andre@51: ;-------------------------------- andre@51: ; Interface Settings andre@51: andre@51: ; MUI Images / Icons andre@51: !define MUI_HEADERIMAGE andre@51: !define MUI_HEADERIMAGE_BITMAP "resources\header-install.bmp" andre@51: !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\wizard-install.bmp" andre@51: !define MUI_ICON "resources\install.ico" andre@51: andre@51: !define MUI_HEADERIMAGE_UNBITMAP "resources\header-uninstall.bmp" andre@51: !define MUI_UNWELCOMEFINISHPAGE_BITMAP "resources\wizard-uninstall.bmp" andre@51: !define MUI_UNICON "resources\uninstall.ico" andre@51: andre@51: !insertmacro MUI_RESERVEFILE_LANGDLL andre@51: !define MUI_LANGDLL_REGISTRY_ROOT "SHCTX" andre@51: !define MUI_LANGDLL_REGISTRY_KEY "Software\${productname_short}" andre@51: !define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" andre@51: andre@51: ;-------------------------------- andre@51: ; Pages andre@51: andre@51: !define MUI_FINISHPAGE_TITLE "$(T_finish_title)" andre@51: !define MUI_FINISHPAGE_TEXT "$(T_finish_text)" andre@51: andre@51: ; MUI welcome page text andre@51: ;!define MUI_WELCOMEPAGE_TITLE "$(T_title)" andre@51: ;!define MUI_WELCOMEPAGE_TITLE_3LINES andre@51: ;!define MUI_WELCOMEPAGE_TEXT "$(T_description) $\r$\n$\r$\n$\r$\n$\r$\n" andre@51: andre@51: ;!insertmacro MUI_PAGE_WELCOME andre@51: !insertmacro MUI_PAGE_DIRECTORY andre@51: !insertmacro MUI_PAGE_INSTFILES andre@51: !insertmacro MUI_PAGE_FINISH andre@51: andre@51: !insertmacro MUI_UNPAGE_WELCOME andre@51: !insertmacro MUI_UNPAGE_INSTFILES andre@51: andre@51: andre@51: ;-------------------------------- andre@51: ;Supported Languages andre@51: andre@51: !insertmacro MUI_LANGUAGE "German" andre@51: !insertmacro MUI_LANGUAGE "English" andre@51: andre@51: ;-------------------------------- andre@51: ; Install Functions andre@51: andre@51: Function ".onInit" andre@51: !insertmacro MUI_LANGDLL_DISPLAY andre@51: !insertmacro MULTIUSER_INIT andre@51: FunctionEnd andre@51: andre@51: ;-------------------------------- andre@51: ; UnInstall Functions andre@51: Function "un.onInit" andre@51: !insertmacro MULTIUSER_UNINIT andre@51: FunctionEnd andre@51: andre@51: Section "" andre@51: ; The actual installation andre@51: SetOutPath "$INSTDIR" andre@51: !include "filelist_in.nsh" andre@51: ; Store install directory andre@51: DetailPrint "$(T_registry)" andre@51: WriteRegStr SHCTX "Software\${productname_short}" "" $INSTDIR andre@51: andre@51: ; Create uninstaller andre@51: WriteUninstaller "$INSTDIR\Uninstall.exe" andre@51: andre@51: ; Register Uninstaller andre@51: andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "DisplayName" "${productname}" andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "DisplayIcon" "$\"$INSTDIR\${productname_short}.exe$\"" andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "DisplayVersion" "${version_number}" andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "Publisher" "Intevation GmbH" andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "URLInfoAbout" "${info_url}" andre@51: WriteRegDword SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "EstimatedSize" "${size}" andre@51: andre@51: andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" andre@51: WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" \ andre@51: "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" andre@51: andre@51: ; Set up File Extension .edu andre@51: # .edu andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "" "$(T_File_Type_edu_Name)" andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "FriendlyTypeName" "$(T_File_Type_edu_Name)" andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "PercievedType" "Document" andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "InfoTip" "$(T_File_Type_info_tip)" andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU\shell\open\command" "" "$\"$INSTDIR\${productname_short}.exe$\" $\"%1$\"" andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" "FriendlyAppName" "${productname}" andre@51: WriteRegStr SHCTX "Software\Classes\${productname_short}.AssocFile.EDU\DefaultIcon" "" "$INSTDIR\${productname_short}.exe" andre@51: andre@51: WriteRegBin SHCTX "Software\Classes\.edu\OpenWithProgIDs" "${productname_short}.AssocFile.EDU" 0 andre@51: andre@51: WriteRegStr SHCTX "Software\RegisteredApplications" "${productname_short}" "SOFTWARE\${productname_short}\Capabilities" andre@51: WriteRegStr SHCTX "Software\${productname_short}" "" "${productname}" andre@51: WriteRegStr SHCTX "Software\${productname_short}" "FriendlyAppName" "${productname}" andre@51: andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "ApplicationName" "${productname}" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "ApplicationIcon" "$\"$INSTDIR\${productname_short}.exe$\",0" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "ApplicationDescription" "$(T_description)" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities" "FriendlyAppName" "${productname}" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities\DefaultIcon" "" "$\"$INSTDIR\${productname_short}.exe$\",0" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities\MimeAssociations" "application/edu-app" "${productname_short}.AssocFile.EDU" andre@51: WriteRegExpandStr SHCTX "Software\${productname_short}\Capabilities\shell\open\command" "" "$\"$INSTDIR\${productname_short}.exe$\" $\"%1$\"" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities\shell\open" "FriendlyAppName" "${productname}" andre@51: WriteRegStr SHCTX "Software\${productname_short}\Capabilities\FileAssociations" ".edu" "${productname_short}.AssocFile.EDU" andre@51: andre@51: andre@51: WriteRegStr SHCTX "SOFTWARE\Classes\Applications\${productname_short}.exe\SupportedTypes" ".edu" "" andre@51: WriteRegStr SHCTX "SOFTWARE\Classes\Applications\${productname_short}.exe\shell\open" "FriendlyAppName" "${productname}" andre@51: andre@51: CreateShortCut "$SMPROGRAMS\${productname}.lnk" "$INSTDIR\${productname_short}.exe" andre@51: andre@51: System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)' andre@51: SectionEnd andre@51: andre@51: Section "Uninstall" andre@51: ExpandEnvStrings $0 %APPDATA% andre@51: Delete "$0\${productname_short}\${productname_short}.ini" andre@51: RmDir "$0\${productname_short}" andre@51: !include "filelist_un.nsh" andre@51: ExpandEnvStrings $0 %APPDATA% andre@51: Delete "$INSTDIR\Uninstall.exe" andre@51: RMDir "$INSTDIR" andre@51: DetailPrint "$(T_unregistry)" andre@51: andre@51: DeleteRegKey SHCTX "Software\Classes\${productname_short}.AssocFile.EDU" andre@51: DeleteRegValue SHCTX "Software\Classes\.edu\OpenWithProgIDs" "${productname_short}.AssocFile.EDU" andre@51: DeleteRegValue SHCTX "Software\RegisteredApplications" "${productname_short}" andre@51: DeleteRegKey SHCTX "Software\${productname_short}" andre@51: andre@51: DeleteRegKey SHCTX "SOFTWARE\Classes\Applications\${productname_short}.exe" andre@51: andre@51: ; Remove uninstaller andre@51: DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${productname_short}" andre@51: andre@51: Delete "$SMPROGRAMS\${productname}.lnk" andre@51: andre@51: SectionEnd andre@51: andre@51: LangString T_description ${LANG_ENGLISH} "${productname} is a Software to convert EduApp-Exports into different formats." andre@51: LangString T_description ${LANG_GERMAN} "${productname} ist eine Anwendung um EduApp-Exporte in andere Formate zu konvertieren." andre@51: LangString T_title ${LANG_ENGLISH} "Welcome to the installation of ${productname} ${version_number}$\r$\n$\r$\n$\r$\n$\r$\n" andre@51: LangString T_title ${LANG_GERMAN} "Willkommen zur Installation von ${productname} ${version_number}$\r$\n$\r$\n$\r$\n$\r$\n" andre@51: LangString T_finish_title ${LANG_ENGLISH} "Installation successful" andre@51: LangString T_finish_title ${LANG_GERMAN} "Installation erfolgreich" andre@62: LangString T_finish_text ${LANG_ENGLISH} "${productname} was successfully installed on your computer.$\r$\n$\r$\nFiles ending with .edu are now opened with ${productname}.$\r$\n$\r$\nClick 'Finish' to close the Install-Wizard." andre@62: LangString T_finish_text ${LANG_GERMAN} "${productname} wurde erfolgreich auf ihrem System installiert. $\r$\n$\r$\nDateien mit der endung .edu werden künftig mit ${productname} geöffnet.$\r$\n$\r$\nKlicken Sie auf 'Fertig stellen', um den Installations-Assistenten zu schließen." andre@51: LangString T_File_Type_info_tip ${LANG_ENGLISH} "An EduApp questionaire export." andre@51: LangString T_File_Type_info_tip ${LANG_GERMAN} "Export eines EduApp Fragebogens." andre@51: LangString T_File_Type_edu_Name ${LANG_GERMAN} "EduApp Export" andre@51: LangString T_File_Type_edu_Name ${LANG_ENGLISH} "EduApp Export" andre@51: LangString T_registry ${LANG_GERMAN} "Anwendung wird registiert" andre@51: LangString T_registry ${LANG_ENGLISH} "Registering Application" andre@51: LangString T_unregistry ${LANG_GERMAN} "Entferne Registry Einträge" andre@51: LangString T_unregistry ${LANG_ENGLISH} "Unregistering Application"