最新消息:

ShellLink是NSIS获取修改快捷方式lnk文件目标目录起始位置的插件

nsis 永恒心锁 2439浏览 0评论
/*
ShellLink是NSIS获取修改快捷方式lnk文件目标目录起始位置的插件
shellLink可以获得快捷方式的工作目录,目标文件,命令行参数,图标位置,快捷键,描述,以及相应的设置.
*/
!AddPluginDir "../Plugins"
!define SHELLLINKTEST "$EXEDIRabc.lnk"
Name "Shell Link Example"
OutFile "ShellLink.exe"
ShowInstDetails show
Section "Shell Link Test"
; Create test shortcut
SetOutPath "${NSISDIR}"
CreateShortCut "${SHELLLINKTEST}" "${NSISDIR}makensisw.exe"
"/parameter1 /parameter2" "${NSISDIR}makensisw.exe" 2 SW_SHOWNORMAL
"ALT|CTRL|SHIFT|F5" "a description"
DetailPrint ""
; Get Shortcut Working Directory
ShellLink::GetShortCutWorkingDirectory "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetWorkingDirectory: $0"
; Get Shortcut Target
ShellLink::GetShortCutTarget "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetTarget: $0"
; Get Shortcut Arguments
ShellLink::GetShortCutArgs "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetArgs: $0"
; Get Shortcut Icon Location
ShellLink::GetShortCutIconLocation "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetIconLocation: $0"
; Get Shortcut Icon Index
ShellLink::GetShortCutIconIndex "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetIconIndex: $0"
; Get Shortcut Show Mode
ShellLink::GetShortCutShowMode "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetShowMode: $0"
; Get Shortcut Hotkey(s)
ShellLink::GetShortCutHotkey "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetHotkey: $0"
; Get Shortcut Description
ShellLink::GetShortCutDescription "${SHELLLINKTEST}"
Pop $0
DetailPrint "GetDescriptions: $0"
DetailPrint ""
; Set Shortcut Working Directory
ShellLink::SetShortCutWorkingDirectory "${SHELLLINKTEST}" "$TEMP"
Pop $0
DetailPrint "SetWorkingDirectory: $0"
; Set Shortcut Target
ShellLink::SetShortCutTarget "${SHELLLINKTEST}" "${NSISDIR}NSIS.exe"
Pop $0
DetailPrint "SetTarget: $0"
; Set Shortcut Arguments
ShellLink::SetShortCutArgs "${SHELLLINKTEST}" "-a -b -c"
Pop $0
DetailPrint "SetArgs: $0"
; Set Shortcut Icon Location
ShellLink::SetShortCutIconLocation "${SHELLLINKTEST}" "$SYSDIRshell32.dll"
Pop $0
DetailPrint "SetIconLocation: $0"
; Set Shortcut Icon Index
ShellLink::SetShortCutIconIndex "${SHELLLINKTEST}" "41"
Pop $0
DetailPrint "SetIconIndex: $0"
; Set Shortcut Show Mode
ShellLink::SetShortCutShowMode "${SHELLLINKTEST}" "7"
Pop $0
DetailPrint "SetShowMode: $0"
; Set Shortcut Hotkey(s)
ShellLink::SetShortCutHotkey "${SHELLLINKTEST}" "634"
Pop $0
DetailPrint "SetHotkey: $0"
; Set Shortcut Description
ShellLink::SetShortCutDescription "${SHELLLINKTEST}" "Some Description"
Pop $0
DetailPrint "SetDescriptions: $0"
DetailPrint ""
; Set Shortcut to Run As Administrator
ShellLink::SetRunAsAdministrator "${SHELLLINKTEST}"
Pop $0
DetailPrint "SetRunAsAdministrator: $0"
DetailPrint ""
SectionEnd
; eof
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » ShellLink是NSIS获取修改快捷方式lnk文件目标目录起始位置的插件

您必须 登录 才能发表评论!