; Script generated by the HM NIS Edit Script Wizard. !define VER_MAJOR 2 !define VER_MINOR 5 !define VER_REVISION 0 !define BASE_URL http://download.microsoft.com/download ; .NET Framework ; English ;!define URL_DOTNET_1033 "${BASE_URL}/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe" !define URL_DOTNET_1033 "${BASE_URL}/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe" ; German ;!define URL_DOTNET_1031 "${BASE_URL}/4/f/3/4f3ac857-e063-45d0-9835-83894f20e808/dotnetfx.exe" !define URL_DOTNET_1031 "${BASE_URL}/4/f/3/4f3ac857-e063-45d0-9835-83894f20e808/dotnetfx.exe" ; Spanish ;!define URL_DOTNET_1034 "${BASE_URL}/8/f/0/8f023ff4-2dc1-4f10-9618-333f5b9f8040/dotnetfx.exe" !define URL_DOTNET_1034 "${BASE_URL}/8/f/0/8f023ff4-2dc1-4f10-9618-333f5b9f8040/dotnetfx.exe" ; French ;!define URL_DOTNET_1036 "${BASE_URL}/e/d/a/eda9d4ea-8ec9-4431-8efa-75391fb91421/dotnetfx.exe" !define URL_DOTNET_1036 "${BASE_URL}/e/d/a/eda9d4ea-8ec9-4431-8efa-75391fb91421/dotnetfx.exe" ; Portuguese (Brazil) ;!define URL_DOTNET_1046 "${BASE_URL}/8/c/f/8cf55d0c-235e-4062-933c-64ffdf7e7043/dotnetfx.exe" !define URL_DOTNET_1046 "${BASE_URL}/8/c/f/8cf55d0c-235e-4062-933c-64ffdf7e7043/dotnetfx.exe" ; Chinese (Simplified) ;!define URL_DOTNET_2052 "${BASE_URL}/7/b/9/7b90644d-1af0-42b9-b76d-a2770319a568/dotnetfx.exe" !define URL_DOTNET_2052 "${BASE_URL}/7/b/9/7b90644d-1af0-42b9-b76d-a2770319a568/dotnetfx.exe" ; ... If you need one not listed above you will have to visit the Microsoft Download site, ; select the language you are after and scan the page source to obtain the link. Var "LANGUAGE_DLL_TITLE" Var "LANGUAGE_DLL_INFO" Var "URL_DOTNET" Var "OSLANGUAGE" Var "DOTNET_RETURN_CODE" LangString DESC_REMAINING ${LANG_ENGLISH} " (%d %s%s remaining)" LangString DESC_REMAINING ${LANG_GERMAN} " (%d %s%s verbleibend)" LangString DESC_PROGRESS ${LANG_ENGLISH} "%d.%01dkB/s" ;"%dkB (%d%%) of %dkB @ %d.%01dkB/s" LangString DESC_PROGRESS ${LANG_GERMAN} "%d.%01dkB/s" ;"%dkB (%d%%) von %dkB @ %d.%01dkB/s" LangString DESC_PLURAL ${LANG_ENGLISH} "s" LangString DESC_PLURAL ${LANG_GERMAN} "n" LangString DESC_HOUR ${LANG_ENGLISH} "hour" LangString DESC_HOUR ${LANG_GERMAN} "Stunde" LangString DESC_MINUTE ${LANG_ENGLISH} "minute" LangString DESC_MINUTE ${LANG_GERMAN} "Minute" LangString DESC_SECOND ${LANG_ENGLISH} "second" LangString DESC_SECOND ${LANG_GERMAN} "Sekunde" LangString DESC_CONNECTING ${LANG_ENGLISH} "Connecting..." LangString DESC_CONNECTING ${LANG_GERMAN} "Verbinden..." LangString DESC_DOWNLOADING ${LANG_ENGLISH} "Downloading %s" LangString DESC_DOWNLOADING ${LANG_GERMAN} "Download %s" LangString DESC_SHORTDOTNET ${LANG_ENGLISH} "Microsoft .Net Framework 2.0" LangString DESC_SHORTDOTNET ${LANG_GERMAN} "Microsoft .Net Framework 2.0" LangString DESC_LONGDOTNET ${LANG_ENGLISH} "Microsoft .Net Framework 2.0" LangString DESC_LONGDOTNET ${LANG_GERMAN} "Microsoft .Net Framework 2.0" LangString DESC_DOTNET_DECISION ${LANG_ENGLISH} "$(DESC_SHORTDOTNET) is required.$\nIt is strongly \ advised that you install$\n$(DESC_SHORTDOTNET) before continuing.$\nIf you choose to continue, \ you will need to connect$\nto the internet before proceeding.$\nWould you like to continue with \ the installation?" LangString DESC_DOTNET_DECISION ${LANG_GERMAN} "$(DESC_SHORTDOTNET) wird benötigt.$\nWir epmfehlen \ $\n$(DESC_SHORTDOTNET) zu installieren bevor Sie die Installation fortsetzen.$\nWenn Sie auf weiter klicken, \ ist eine Verbindung$\nins Internet notwendig.$\nmöchten Sie die Installation \ fortsetzen?" LangString SEC_DOTNET ${LANG_ENGLISH} "$(DESC_SHORTDOTNET) " LangString SEC_DOTNET ${LANG_GERMAN} "$(DESC_SHORTDOTNET) " LangString DESC_INSTALLING ${LANG_ENGLISH} "Installing" LangString DESC_INSTALLING ${LANG_GERMAN} "Installiert" LangString DESC_DOWNLOADING1 ${LANG_ENGLISH} "Downloading" LangString DESC_DOWNLOADING1 ${LANG_GERMAN} "Download" LangString DESC_DOWNLOADFAILED ${LANG_ENGLISH} "Download Failed:" LangString DESC_DOWNLOADFAILED ${LANG_GERMAN} "Download fehlgeschlagen:" LangString ERROR_DOTNET_DUPLICATE_INSTANCE ${LANG_ENGLISH} "The $(DESC_SHORTDOTNET) Installer is \ already running." LangString ERROR_DOTNET_DUPLICATE_INSTANCE ${LANG_GERMAN} "Der $(DESC_SHORTDOTNET) Installer ist \ bereits gestartet." LangString ERROR_NOT_ADMINISTRATOR ${LANG_ENGLISH} "$(DESC_000022)" LangString ERROR_NOT_ADMINISTRATOR ${LANG_GERMAN} "$(DESC_000022)" LangString ERROR_INVALID_PLATFORM ${LANG_ENGLISH} "$(DESC_000023)" LangString ERROR_INVALID_PLATFORM ${LANG_GERMAN} "$(DESC_000023)" LangString DESC_DOTNET_TIMEOUT ${LANG_ENGLISH} "The installation of the $(DESC_SHORTDOTNET) \ has timed out." LangString DESC_DOTNET_TIMEOUT ${LANG_GERMAN} "The installation of the $(DESC_SHORTDOTNET) \ has timed out." LangString ERROR_DOTNET_INVALID_PATH ${LANG_ENGLISH} "The $(DESC_SHORTDOTNET) Installation$\n\ was not found in the following location:$\n" LangString ERROR_DOTNET_INVALID_PATH ${LANG_GERMAN} "The $(DESC_SHORTDOTNET) Installation$\n\ was not found in the following location:$\n" LangString ERROR_DOTNET_FATAL ${LANG_ENGLISH} "A fatal error occurred during the installation$\n\ of the $(DESC_SHORTDOTNET)." LangString ERROR_DOTNET_FATAL ${LANG_GERMAN} "A fatal error occurred during the installation$\n\ of the $(DESC_SHORTDOTNET)." LangString PRODUCT_NAME ${LANG_ENGLISH} "UniUploader" LangString PRODUCT_NAME ${LANG_GERMAN} "UniUploader" LangString FAILED_DOTNET_INSTALL ${LANG_ENGLISH} "The installation of $(PRODUCT_NAME) will$\n\ continue. However, it may not function properly$\nuntil $(DESC_SHORTDOTNET)$\nis installed." LangString FAILED_DOTNET_INSTALL ${LANG_GERMAN} "The installation of $(PRODUCT_NAME) will$\n\ continue. However, it may not function properly$\nuntil $(DESC_SHORTDOTNET)$\nis installed." ; HM NIS Edit Wizard helper defines !define PRODUCT_NAME "UniUploader" !define PRODUCT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}" !define PRODUCT_PUBLISHER "Matt Miller" !define PRODUCT_WEB_SITE "http://www.wowroster.net" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\UniUploader.exe" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" !define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir" SetCompressor /SOLID lzma ; MUI 1.67 compatible ------ !include "MUI.nsh" ; MUI Settings !define MUI_ABORTWARNING !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; License page !insertmacro MUI_PAGE_LICENSE "LICENSE.TXT" ; Directory page !insertmacro MUI_PAGE_DIRECTORY ; Start menu page var ICONS_GROUP !define MUI_STARTMENUPAGE_NODISABLE !define MUI_STARTMENUPAGE_DEFAULTFOLDER "UniUploader" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}" !define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}" !insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !define MUI_FINISHPAGE_RUN "$INSTDIR\UniUploader.exe" !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_INSTFILES ; Language files !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_LANGUAGE "German" ; Reserve files !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ; MUI end ------ Name "${PRODUCT_NAME}" OutFile "${PRODUCT_NAME}_v${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}_Installer.exe" InstallDir "$PROGRAMFILES\UniUploader" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" ShowInstDetails show ShowUnInstDetails show Section $(SEC_DOTNET) SECDOTNET Call IsDotNETInstalled Pop $R3 ;MessageBox MB_ICONEXCLAMATION|MB_YESNO|MB_DEFBUTTON2 "$R3" StrCmp $R3 "1" lbl_isinstalled lbl_notinstalled lbl_notinstalled: SectionIn RO IfSilent lbl_IsSilent !define DOTNETFILESDIR "Common\Files\MSNET" StrCpy $DOTNET_RETURN_CODE "0" !ifdef DOTNET_ONCD_1033 StrCmp "$OSLANGUAGE" "1033" 0 lbl_Not1033 SetOutPath "$PLUGINSDIR" file /r "${DOTNETFILESDIR}\dotnetfx1033.exe" DetailPrint "$(DESC_INSTALLING) $(DESC_SHORTDOTNET)..." Banner::show /NOUNLOAD "$(DESC_INSTALLING) $(DESC_SHORTDOTNET)..." nsExec::ExecToStack '"$PLUGINSDIR\dotnetfx1033.exe" /q /c:"install.exe /noaspupgrade /q"' pop $DOTNET_RETURN_CODE Banner::destroy SetRebootFlag false Goto lbl_NoDownloadRequired lbl_Not1033: !endif ; Insert Other language blocks here ; the following Goto and Label is for consistencey. Goto lbl_DownloadRequired lbl_DownloadRequired: DetailPrint "$(DESC_DOWNLOADING1) $(DESC_SHORTDOTNET)..." MessageBox MB_ICONEXCLAMATION|MB_YESNO|MB_DEFBUTTON2 "$(DESC_DOTNET_DECISION)" /SD IDNO \ IDYES +2 IDNO 0 Abort ; "Downloading Microsoft .Net Framework" AddSize 153600 nsisdl::download /TRANSLATE "$(DESC_DOWNLOADING)" "$(DESC_CONNECTING)" \ "$(DESC_SECOND)" "$(DESC_MINUTE)" "$(DESC_HOUR)" "$(DESC_PLURAL)" \ "$(DESC_PROGRESS)" "$(DESC_REMAINING)" \ /TIMEOUT=30000 "$URL_DOTNET" "$PLUGINSDIR\dotnetfx.exe" Pop $0 StrCmp "$0" "success" lbl_continue DetailPrint "$(DESC_DOWNLOADFAILED) $0" Abort lbl_continue: DetailPrint "$(DESC_INSTALLING) $(DESC_SHORTDOTNET)..." Banner::show /NOUNLOAD "$(DESC_INSTALLING) $(DESC_SHORTDOTNET)..." nsExec::ExecToStack '"$PLUGINSDIR\dotnetfx.exe" /q /c:"install.exe /noaspupgrade /q"' pop $DOTNET_RETURN_CODE Banner::destroy SetRebootFlag false ; silence the compiler Goto lbl_NoDownloadRequired lbl_NoDownloadRequired: ; obtain any error code and inform the user ($DOTNET_RETURN_CODE) ; If nsExec is unable to execute the process, ; it will return "error" ; If the process timed out it will return "timeout" ; else it will return the return code from the executed process. StrCmp "$DOTNET_RETURN_CODE" "" lbl_NoError StrCmp "$DOTNET_RETURN_CODE" "0" lbl_NoError StrCmp "$DOTNET_RETURN_CODE" "3010" lbl_NoError StrCmp "$DOTNET_RETURN_CODE" "8192" lbl_NoError StrCmp "$DOTNET_RETURN_CODE" "error" lbl_Error StrCmp "$DOTNET_RETURN_CODE" "timeout" lbl_TimeOut ; It's a .Net Error StrCmp "$DOTNET_RETURN_CODE" "4101" lbl_Error_DuplicateInstance StrCmp "$DOTNET_RETURN_CODE" "4097" lbl_Error_NotAdministrator StrCmp "$DOTNET_RETURN_CODE" "1633" lbl_Error_InvalidPlatform lbl_FatalError ; all others are fatal lbl_Error_DuplicateInstance: DetailPrint "$(ERROR_DOTNET_DUPLICATE_INSTANCE)" GoTo lbl_Done lbl_Error_NotAdministrator: DetailPrint "$(ERROR_NOT_ADMINISTRATOR)" GoTo lbl_Done lbl_Error_InvalidPlatform: DetailPrint "$(ERROR_INVALID_PLATFORM)" GoTo lbl_Done lbl_TimeOut: DetailPrint "$(DESC_DOTNET_TIMEOUT)" GoTo lbl_Done lbl_Error: DetailPrint "$(ERROR_DOTNET_INVALID_PATH)" GoTo lbl_Done lbl_FatalError: DetailPrint "$(ERROR_DOTNET_FATAL)[$DOTNET_RETURN_CODE]" GoTo lbl_Done lbl_Done: DetailPrint "$(FAILED_DOTNET_INSTALL)" lbl_NoError: lbl_IsSilent: lbl_isinstalled: SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SECDOTNET} $(DESC_LONGDOTNET) !insertmacro MUI_FUNCTION_DESCRIPTION_END Function .onInit StrCpy $LANGUAGE_DLL_TITLE "Installer Language" StrCpy $LANGUAGE_DLL_INFO "Please select a language:" StrCpy $URL_DOTNET "${URL_DOTNET_1033}" StrCpy $OSLANGUAGE "1033" ; Insert other Language Blocks Here !define MUI_LANGDLL_WINDOWTITLE "$LANGUAGE_DLL_TITLE" !define MUI_LANGDLL_INFO "$LANGUAGE_DLL_INFO" !insertmacro MUI_LANGDLL_DISPLAY !undef MUI_LANGDLL_WINDOWTITLE !undef MUI_LANGDLL_INFO InitPluginsDir ;SetOutPath "$PLUGINSDIR" ;File "Common\Plugins\*.*" ;File /r "${NSISDIR}\Plugins\*.*" FunctionEnd Function IsDotNETInstalled Push $0 Push $1 Push $2 Push $3 Push $4 ReadRegStr $4 HKEY_LOCAL_MACHINE \ "Software\Microsoft\.NETFramework" "InstallRoot" # remove trailing back slash Push $4 Exch $EXEDIR Exch $EXEDIR Pop $4 # if the root directory doesn't exist .NET is not installed IfFileExists $4 0 noDotNET StrCpy $0 0 EnumStart: EnumRegKey $2 HKEY_LOCAL_MACHINE \ "Software\Microsoft\.NETFramework\Policy" $0 IntOp $0 $0 + 1 StrCmp $2 "" noDotNET StrCpy $1 0 EnumPolicy: EnumRegValue $3 HKEY_LOCAL_MACHINE \ "Software\Microsoft\.NETFramework\Policy\$2" $1 IntOp $1 $1 + 1 StrCmp $3 "" EnumStart IfFileExists "$4\$2.$3" foundDotNET EnumPolicy noDotNET: StrCpy $0 0 Goto done foundDotNET: StrCpy $0 1 done: Pop $4 Pop $3 Pop $2 Pop $1 Exch $0 FunctionEnd Section "MainSection" SEC01 SetOutPath "$INSTDIR" SetOverwrite on File "UniUploader.exe" File "LICENSE.TXT" ; The following lines are for preconfigured Guild Releases. If you want ; to release it to a specific Guild with a preconfigured .ini file, just ; uncomment the following line and it will be included in the install File "settings.ini" SetOverwrite ifnewer File "logo1.gif" File "logo2.gif" ; Shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$ICONS_GROUP" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\UniUploader.lnk" "$INSTDIR\UniUploader.exe" CreateShortCut "$DESKTOP\UniUploader.lnk" "$INSTDIR\UniUploader.exe" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section -AdditionalIcons !insertmacro MUI_STARTMENU_WRITE_BEGIN Application WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url" CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section -Post WriteUninstaller "$INSTDIR\uninst.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\UniUploader.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\UniUploader.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}" SectionEnd Function un.onUninstSuccess HideWindow MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." FunctionEnd Function un.onInit MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2 Abort FunctionEnd Section Uninstall !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP Delete "$INSTDIR\${PRODUCT_NAME}.url" Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\logo2.gif" Delete "$INSTDIR\logo1.gif" Delete "$INSTDIR\UniUploader.exe" Delete "$INSTDIR\languages.ini" Delete "$INSTDIR\LICENSE.TXT" Delete "$INSTDIR\RespNotepad.htm" Delete "$INSTDIR\SiteSVIE.htm" Delete "$INSTDIR\SiteSVNotepad.htm" Delete "$INSTDIR\debug_notepad.txt" Delete "$INSTDIR\debug_ie.txt" Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" Delete "$SMPROGRAMS\$ICONS_GROUP\Website.lnk" Delete "$DESKTOP\UniUploader.lnk" Delete "$SMPROGRAMS\$ICONS_GROUP\UniUploader.lnk" RMDir "$SMPROGRAMS\$ICONS_GROUP" RMDir "$INSTDIR" DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}" SetAutoClose true SectionEnd