nsis 固定到任务栏

nsis 固定到任务栏 win7以上有效

Name "测试"

OutFile "test.exe"

Section 
        CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\test.lnk" "$INSTDIR\AppCan-IDE\test.exe"
	ExecShell taskbarpin "$SMPROGRAMS\${PRODUCT_NAME}\test.lnk"
SectionEnd

链接的文件必须是lnk文件才行 直接exe文件是无效的,删除快速启动栏图标的,不清楚 -_-#

下面这些代码没做测试

    # 任务栏快捷方式
    Pop $0
    ${If} $0 == "0"
		ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "CurrentVersion"
		${if} $R0 >= 6.0  # Vista以上  锁定任务栏
			CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_MAIN_EXE}"
			ExecShell taskbarpin "$DESKTOP\${PRODUCT_NAME}.lnk"
		${else}           # XP以下  快速任务栏
			IfFileExists "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" 0 +2
				Delete "$QUICKLAUNCH\${PRODUCT_NAME}.lnk";
			CreateShortCut "$QUICKLAUNCH\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_MAIN_EXE}"
		${Endif}
    ${EndIf}
posted @ 2014-10-30 15:24  nil  阅读(1046)  评论(0编辑  收藏  举报