| ; Script generated by the HM NIS Edit Script Wizard. |
| |
| ; Licensed to the Apache Software Foundation (ASF) under one * |
| ; or more contributor license agreements. See the NOTICE file * |
| ; distributed with this work for additional information * |
| ; regarding copyright ownership. The ASF licenses this file * |
| ; to you under the Apache License, Version 2.0 (the * |
| ; "License"); you may not use this file except in compliance * |
| ; with the License. You may obtain a copy of the License at * |
| ; * |
| ; http://www.apache.org/licenses/LICENSE-2.0 * |
| ; * |
| ; Unless required by applicable law or agreed to in writing, * |
| ; software distributed under the License is distributed on an * |
| ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * |
| ; KIND, either express or implied. See the License for the * |
| ; specific language governing permissions and limitations * |
| ; under the License. * |
| |
| ; HM NIS Edit Wizard helper defines |
| !define PRODUCT_NAME "Visual Studio Add-In for Apache Etch" |
| !define PRODUCT_VERSION "1.0" |
| !define PRODUCT_PUBLISHER "Apache Software Foundation" |
| !define PRODUCT_WEB_SITE "http://incubator.apache.org/projects/etch.html" |
| !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" |
| !define PRODUCT_UNINST_ROOT_KEY "HKLM" |
| !define ETCH_CS_ASSEMBLY_FOLDER "SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\Etch" |
| !define SHELL_FOLDERS "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" |
| !define VS_FOLDER "SOFTWARE\Microsoft\VisualStudio\8.0" |
| |
| ; MUI 1.67 compatible ------ |
| !include "MUI.nsh" |
| |
| ; MUI Settings |
| !define MUI_ABORTWARNING |
| !define MUI_ICON "modern-install.ico" |
| !define MUI_UNICON "modern-uninstall.ico" |
| !define MUI_WELCOMEPAGE_TITLE_3LINES |
| |
| ; Welcome page |
| !insertmacro MUI_PAGE_WELCOME |
| |
| ; Etch Installation Folder |
| Var ETCH_HOME |
| !define MUI_DIRECTORYPAGE_VARIABLE $ETCH_HOME |
| !define MUI_PAGE_HEADER_TEXT "Apache Etch Home Directory." |
| !define MUI_PAGE_HEADER_SUBTEXT "Choose the folder in which Etch package is installed." |
| !define MUI_DIRECTORYPAGE_TEXT_TOP "Please browse to Apache Etch home directory." |
| !define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Apache Etch home directory" |
| !insertmacro MUI_PAGE_DIRECTORY |
| |
| ; Directory page |
| !insertmacro MUI_PAGE_DIRECTORY |
| |
| ; Instfiles page |
| !insertmacro MUI_PAGE_INSTFILES |
| |
| ; Finish page |
| !insertmacro MUI_PAGE_FINISH |
| |
| ; Uninstaller pages |
| !insertmacro MUI_UNPAGE_INSTFILES |
| |
| ; Language files |
| !insertmacro MUI_LANGUAGE "English" |
| |
| ; MUI end ------ |
| |
| Name "${PRODUCT_NAME}" |
| OutFile "VSAddInSetup.exe" |
| InstallDir "$PROGRAMFILES\Visual Studio Add-In for Apache Etch" |
| ShowInstDetails hide |
| ShowUnInstDetails hide |
| XPStyle "on" |
| RequestExecutionLevel admin |
| |
| Section "Visual Studio Add-In for Apache Etch" SEC01 |
| SetOutPath "$INSTDIR" |
| SetOverwrite try |
| File "EtchAddIn.dll" |
| File "Etch.AddIn" |
| File "VS2005_AddIn_User_Guide.rtf" |
| WriteRegStr HKLM "${ETCH_CS_ASSEMBLY_FOLDER}" "" "$ETCH_HOME\lib" |
| ReadRegStr $0 HKCU "${SHELL_FOLDERS}" Personal |
| SetOutPath "$0\Visual Studio 2005\Addins\" |
| SetOverwrite try |
| File "EtchAddIn.dll" |
| File "Etch.AddIn" |
| SectionEnd |
| |
| Section -AdditionalIcons |
| SetOutPath $INSTDIR |
| CreateDirectory "$SMPROGRAMS\Visual Studio Add-In for Apache Etch" |
| CreateShortCut "$SMPROGRAMS\Visual Studio Add-In for Apache Etch\User Guide.lnk" "$INSTDIR\VS2005_AddIn_User_Guide.rtf" |
| CreateShortCut "$SMPROGRAMS\Visual Studio Add-In for Apache Etch\Uninstall.lnk" "$INSTDIR\uninst.exe" |
| SectionEnd |
| |
| Section -Post |
| WriteUninstaller "$INSTDIR\uninst.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}" "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." |
| ReadRegStr $0 HKLM "${VS_FOLDER}" InstallDir |
| ExecWait '$0\devenv.exe /ResetAddin Etch' |
| FunctionEnd |
| |
| Function un.onInit |
| MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name)?" IDYES +2 |
| Abort |
| FunctionEnd |
| |
| Section Uninstall |
| MessageBox MB_ICONEXCLAMATION|MB_OK|MB_TOPMOST "Please close Visual Studio 2005 and click OK to continue." |
| DeleteRegValue HKLM "${ETCH_CS_ASSEMBLY_FOLDER}" "" |
| DeleteRegKey HKLM "${ETCH_CS_ASSEMBLY_FOLDER}" |
| ReadRegStr $0 HKCU "${SHELL_FOLDERS}" Personal |
| Delete "$0\Visual Studio 2005\Addins\EtchAddIn.dll" |
| Delete "$0\Visual Studio 2005\Addins\Etch.AddIn" |
| Delete "$INSTDIR\EtchAddIn.dll" |
| Delete "$INSTDIR\Etch.AddIn" |
| Delete "$INSTDIR\VS2005_AddIn_User_Guide.rtf" |
| Delete "$INSTDIR\uninst.exe" |
| Delete "$SMPROGRAMS\Visual Studio Add-In for Apache Etch\User Guide.lnk" |
| Delete "$SMPROGRAMS\Visual Studio Add-In for Apache Etch\Uninstall.lnk" |
| RMDir "$SMPROGRAMS\Visual Studio Add-In for Apache Etch" |
| DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" |
| SetAutoClose true |
| SectionEnd |