Changeset 373:cf2b6b8a3973 for mlx.nsi
- Timestamp:
- 12/18/12 10:08:43 (11 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mlx.nsi
r28 r373 5 5 6 6 !include "MUI.nsh" 7 !include "nsDialogs.nsh" 8 !include "TextFunc.nsh" 7 9 !include "mlx-common.nsh" 8 10 9 11 ;-------------------------------- 10 12 ;General 13 14 Var ApplicationName 15 16 Function .onInit 17 StrCpy $ApplicationName "Mava Logger X" 18 FunctionEnd 11 19 12 20 ;Name and file … … 17 25 ;Default installation folder 18 26 InstallDir "$PROGRAMFILES\MAVA Logger X" 19 20 ;Get installation folder from registry if available21 InstallDirRegKey HKCU "Software\MAVA Logger X" ""22 27 23 28 ;Vista redirects $SMPROGRAMS to all users without this … … 29 34 Var MUI_TEMP 30 35 Var STARTMENU_FOLDER 36 Var Variable 37 Var Secondary 38 Var Secondary_State 39 Var LinkName 40 Var Parameters 31 41 32 42 ;-------------------------------- … … 40 50 ;Pages 41 51 52 42 53 !insertmacro MUI_PAGE_LICENSE "license.txt" 54 Page custom optionsPage ;optionsPageLeave 43 55 !insertmacro MUI_PAGE_COMPONENTS 44 56 !insertmacro MUI_PAGE_DIRECTORY 45 57 46 58 ;Start Menu Folder Page Configuration 47 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU"48 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MAVA Logger X"49 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"50 59 ;!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" 60 ;!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MAVA Logger X" 61 ;!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" 62 51 63 !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER 52 64 53 65 !insertmacro MUI_PAGE_INSTFILES 54 66 55 67 !insertmacro MUI_UNPAGE_CONFIRM 56 68 !insertmacro MUI_UNPAGE_INSTFILES 57 69 70 Function optionsPage 71 !insertmacro MUI_HEADER_TEXT "Installation Options" "Choose the options for the installation" 72 73 nsDialogs::Create 1018 74 Pop $Variable 75 76 ${If} $Variable == error 77 Abort 78 ${Endif} 79 80 ${NSD_CreateLabel} 0 0 100% 24u "If you select the option below, the program will be installed in a way that it can be used besides another, already existing installation. Read the manual on how to set up this secondary version to avoid conflicting with the primary one." 81 Pop $Variable 82 83 ${NSD_CreateCheckBox} 12 54 100% 12u "Install as secondary" 84 Pop $Secondary 85 ${NSD_SetState} $Secondary $Secondary_State 86 GetFunctionAddress $Variable onSecondaryClicked 87 nsDialogs::onClick $Secondary $Variable 88 89 nsDialogs::Show 90 FunctionEnd 91 92 Function onSecondaryClicked 93 Pop $Secondary 94 ${NSD_GetState} $Secondary $Secondary_State 95 ${If} $Secondary_State == ${BST_CHECKED} 96 StrCpy $INSTDIR "$PROGRAMFILES\MAVA Logger X (Secondary)" 97 StrCpy $STARTMENU_FOLDER "MAVA Logger X (Secondary)" 98 ${Else} 99 StrCpy $INSTDIR "$PROGRAMFILES\MAVA Logger X" 100 StrCpy $STARTMENU_FOLDER "MAVA Logger X" 101 ${EndIf} 102 FunctionEnd 103 58 104 ;-------------------------------- 59 105 ;Languages 60 106 61 107 !insertmacro MUI_LANGUAGE "English" 62 108 … … 67 113 68 114 SetOutPath "$INSTDIR" 69 115 116 ${If} $Secondary_State == ${BST_CHECKED} 117 StrCpy $LinkName "MAVA Logger X (Secondary)" 118 StrCpy $Parameters "secondary" 119 ${Else} 120 StrCpy $LinkName "MAVA Logger X" 121 StrCpy $Parameters "" 122 ${EndIf} 123 70 124 ;ADD YOUR OWN FILES HERE... 71 125 File /r dist\*.* 72 126 73 ;Store installation folder 74 WriteRegStr HKCU "Software\MAVA Logger X" "" $INSTDIR 75 127 ;Create the uninstaller config file 128 ${ConfigWrite} "$INSTDIR\Uninstall.conf" "StartMenuFolder=" "$STARTMENU_FOLDER" $Variable 129 ${ConfigWrite} "$INSTDIR\Uninstall.conf" "LinkName=" "$LinkName" $Variable 130 76 131 ;Create uninstaller 132 77 133 WriteUninstaller "$INSTDIR\Uninstall.exe" 78 134 … … 80 136 ;Create shortcuts 81 137 CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" 82 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\MAVA Logger X.lnk" "$INSTDIR\runmlx.exe" 138 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\MAVA Logger X.lnk" "$INSTDIR\runmlx.exe" "$Parameters" 83 139 CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" 84 CreateShortCut "$DESKTOP\ MAVA Logger X.lnk" "$INSTDIR\runmlx.exe"140 CreateShortCut "$DESKTOP\$LinkName.lnk" "$INSTDIR\runmlx.exe" "$Parameters" 85 141 !insertmacro MUI_STARTMENU_WRITE_END 86 142 SectionEnd … … 102 158 Section "Uninstall" 103 159 160 ;Read the uninstaller config file 161 ${ConfigRead} "$INSTDIR\Uninstall.conf" "StartMenuFolder=" $MUI_TEMP 162 ${ConfigRead} "$INSTDIR\Uninstall.conf" "LinkName=" $LinkName 163 104 164 RMDir /r "$INSTDIR" 105 165 106 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP 107 108 Delete "$DESKTOP\MAVA Logger X.lnk" 166 Delete "$DESKTOP\$LinkName.lnk" 109 167 Delete "$SMPROGRAMS\$MUI_TEMP\MAVA Logger X.lnk" 110 168 Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" 111 169 112 170 ;Delete empty start menu parent diretories 113 171 StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" 114 172 115 173 startMenuDeleteLoop: 116 174 ClearErrors 117 175 RMDir $MUI_TEMP 118 176 GetFullPathName $MUI_TEMP "$MUI_TEMP\.." 119 177 120 178 IfErrors startMenuDeleteLoopDone 121 179 122 180 StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop 123 181 startMenuDeleteLoopDone: 124 125 DeleteRegKey /ifempty HKCU "Software\MAVA Logger X"126 182 SectionEnd
Note:
See TracChangeset
for help on using the changeset viewer.