NSIS PinToTaskbar&Start
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | Caption "StdUtils Test-Suite" !addincludedir "..\..\Include" !ifdef NSIS_UNICODE !addplugindir "..\..\Plugins\Release_Unicode" OutFile "InvokeShellVerb-Unicode.exe" ! else !addplugindir "..\..\Plugins\Release_ANSI" OutFile "InvokeShellVerb-ANSI.exe" !endif !include 'StdUtils.nsh' RequestExecutionLevel user ;no elevation needed for this test ShowInstDetails show Section IfFileExists "$SYSDIR\mspaint.exe" +3 MessageBox MB_ICONSTOP 'File does not exist:$\n"$SYSDIR\mspaint.exe"$\n$\nExample cannot run!' Quit MessageBox MB_OK "Please make sure Paint isn't pinned to your Taskbar right now.$\nThen press 'OK' to begin test..." SectionEnd Section DetailPrint "Going to pin MSPaint..." DetailPrint 'InvokeShellVerb: "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.PinToTaskbar}' ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.PinToTaskbar} DetailPrint "Result: $0" StrCmp "$0" "ok" 0 +3 MessageBox MB_TOPMOST "Paint should have been pinned to Taskbar now!" Goto +2 MessageBox MB_TOPMOST "Failed to pin, see log for details!" DetailPrint "--------------" SectionEnd Section DetailPrint "Going to un-pin MSPaint..." DetailPrint 'InvokeShellVerb: "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar}' ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.UnpinFromTaskbar} DetailPrint "Result: $0" StrCmp "$0" "ok" 0 +3 MessageBox MB_TOPMOST "Paint should have been un-pinned from Taskbar now!" Goto +2 MessageBox MB_TOPMOST "Failed to un-pin, see log for details!" DetailPrint "--------------" SectionEnd Section IfFileExists "$SYSDIR\mspaint.exe" +3 MessageBox MB_ICONSTOP 'File does not exist:$\n"$SYSDIR\mspaint.exe"$\n$\nExample cannot run!' Quit MessageBox MB_OK "Please make sure Paint isn't pinned to your Startmenu right now.$\nThen press 'OK' to begin test..." SectionEnd Section DetailPrint "Going to pin MSPaint..." DetailPrint 'InvokeShellVerb: "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.PinToStart}' ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.PinToStart} DetailPrint "Result: $0" StrCmp "$0" "ok" 0 +3 MessageBox MB_TOPMOST "Paint should have been pinned to Start now!" Goto +2 MessageBox MB_TOPMOST "Failed to pin, see log for details!" DetailPrint "--------------" SectionEnd Section DetailPrint "Going to un-pin MSPaint..." DetailPrint 'InvokeShellVerb: "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.UnpinFromStart}' ${StdUtils.InvokeShellVerb} $0 "$SYSDIR" "mspaint.exe" ${StdUtils.Const.ShellVerb.UnpinFromStart} DetailPrint "Result: $0" StrCmp "$0" "ok" 0 +3 MessageBox MB_TOPMOST "Paint should have been un-pinned from Start now!" Goto +2 MessageBox MB_TOPMOST "Failed to un-pin, see log for details!" DetailPrint "--------------" SectionEnd |
插件下载:https://github.com/lordmulder/stdutils