Fix some bugs and inconsistencies in installer

Closes #1100
This commit is contained in:
vlakoff 2015-11-06 00:59:38 +01:00 committed by Don Ho
parent 9a419cec57
commit 48238b704b

View File

@ -306,7 +306,7 @@ Function ExtraOptions
Pop $NoUserDataCheckboxHandle Pop $NoUserDataCheckboxHandle
${NSD_OnClick} $NoUserDataCheckboxHandle OnChange_NoUserDataCheckBox ${NSD_OnClick} $NoUserDataCheckboxHandle OnChange_NoUserDataCheckBox
${NSD_CreateCheckbox} 0 50 100% 30u "Allow plugins to be loaded from %APPDATA%\\notepad++\\plugins$\nIt could cause a security issue. Turn it on if you know what you are doing." ${NSD_CreateCheckbox} 0 50 100% 30u "Allow plugins to be loaded from %APPDATA%\notepad++\plugins$\nIt could cause a security issue. Turn it on if you know what you are doing."
Pop $PluginLoadFromUserDataCheckboxHandle Pop $PluginLoadFromUserDataCheckboxHandle
${NSD_OnClick} $PluginLoadFromUserDataCheckboxHandle OnChange_PluginLoadFromUserDataCheckBox ${NSD_OnClick} $PluginLoadFromUserDataCheckboxHandle OnChange_PluginLoadFromUserDataCheckBox
@ -314,7 +314,7 @@ Function ExtraOptions
Pop $ShortcutCheckboxHandle Pop $ShortcutCheckboxHandle
StrCmp $WinVer "8" 0 +2 StrCmp $WinVer "8" 0 +2
${NSD_Check} $ShortcutCheckboxHandle ${NSD_Check} $ShortcutCheckboxHandle
${NSD_OnClick} $ShortcutCheckboxHandle ShortcutOnChange_OldIconCheckBox ${NSD_OnClick} $ShortcutCheckboxHandle OnChange_ShortcutCheckBox
${NSD_CreateCheckbox} 0 170 100% 30u "Use the old, obsolete and monstrous icon$\nI won't blame you if you want to get the old icon back :)" ${NSD_CreateCheckbox} 0 170 100% 30u "Use the old, obsolete and monstrous icon$\nI won't blame you if you want to get the old icon back :)"
Pop $OldIconCheckboxHandle Pop $OldIconCheckboxHandle
@ -325,8 +325,8 @@ FunctionEnd
Var noUserDataChecked Var noUserDataChecked
Var allowPluginLoadFromUserDataChecked Var allowPluginLoadFromUserDataChecked
Var isOldIconChecked
Var createShortcutChecked Var createShortcutChecked
Var isOldIconChecked
; TODO for optional arg ; TODO for optional arg
;Var params ;Var params
@ -340,12 +340,12 @@ Function OnChange_PluginLoadFromUserDataCheckBox
${NSD_GetState} $PluginLoadFromUserDataCheckboxHandle $allowPluginLoadFromUserDataChecked ${NSD_GetState} $PluginLoadFromUserDataCheckboxHandle $allowPluginLoadFromUserDataChecked
FunctionEnd FunctionEnd
Function OnChange_OldIconCheckBox Function OnChange_ShortcutCheckBox
${NSD_GetState} $OldIconCheckboxHandle $isOldIconChecked ${NSD_GetState} $ShortcutCheckboxHandle $createShortcutChecked
FunctionEnd FunctionEnd
Function ShortcutOnChange_OldIconCheckBox Function OnChange_OldIconCheckBox
${NSD_GetState} $ShortcutCheckboxHandle $createShortcutChecked ${NSD_GetState} $OldIconCheckboxHandle $isOldIconChecked
FunctionEnd FunctionEnd
@ -550,7 +550,7 @@ Section -"Notepad++" mainSection
Delete "$SMPROGRAMS\Notepad++\Notepad++.lnk" Delete "$SMPROGRAMS\Notepad++\Notepad++.lnk"
Delete "$SMPROGRAMS\Notepad++\readme.lnk" Delete "$SMPROGRAMS\Notepad++\readme.lnk"
Delete "$SMPROGRAMS\Notepad++\Uninstall.lnk" Delete "$SMPROGRAMS\Notepad++\Uninstall.lnk"
CreateDirectory "$SMPROGRAMS\Notepad++" RMDir "$SMPROGRAMS\Notepad++"
; remove unstable plugins ; remove unstable plugins
CreateDirectory "$INSTDIR\plugins\disabled" CreateDirectory "$INSTDIR\plugins\disabled"
@ -695,17 +695,21 @@ Section -"Notepad++" mainSection
UserInfo::GetAccountType UserInfo::GetAccountType
Pop $1 Pop $1
StrCmp $1 "Admin" 0 +2 StrCmp $1 "Admin" 0 +2
SetShellVarContext all SetShellVarContext all
; set the shortcuts working directory
; http://nsis.sourceforge.net/Docs/Chapter4.html#createshortcut
SetOutPath "$INSTDIR\"
; add all the npp shortcuts for all user or current user ; add all the npp shortcuts for all user or current user
CreateDirectory "$SMPROGRAMS\Notepad++" CreateDirectory "$SMPROGRAMS\Notepad++"
CreateShortCut "$SMPROGRAMS\Notepad++\Notepad++.lnk" "$INSTDIR\notepad++.exe" CreateShortCut "$SMPROGRAMS\Notepad++\Notepad++.lnk" "$INSTDIR\notepad++.exe"
SetShellVarContext current
${If} $createShortcutChecked == ${BST_CHECKED} ${If} $createShortcutChecked == ${BST_CHECKED}
CreateShortCut "$DESKTOP\Notepad++.lnk" "$INSTDIR\notepad++.exe" CreateShortCut "$DESKTOP\Notepad++.lnk" "$INSTDIR\notepad++.exe"
${EndIf} ${EndIf}
SetShellVarContext current
${If} $isOldIconChecked == ${BST_CHECKED} ${If} $isOldIconChecked == ${BST_CHECKED}
SetOutPath "$TEMP\" SetOutPath "$TEMP\"
File "..\misc\vistaIconTool\changeIcon.exe" File "..\misc\vistaIconTool\changeIcon.exe"