c : windows installer에서 끝나는 링크에 맞는 .lnk 대상을 해결하는 방법이 있습니까?

StackOverflow https://stackoverflow.com/questions/964444

문제

LNK를 해결하는 일반적인 방법에는 WSHELL.WSHSHORTCUT 또는 ISHELLLINK를 사용하는 것이 포함됩니다.

var WshShell = WScript.CreateObject("WScript.Shell");
var oShellLink = WshShell.CreateShortcut(strDesktop + "\\some-shortcut.lnk");
WScript.Echo(oShellLink.TargetPath)

그러나 그런 식으로 해결할 수없는 링크가 있습니다. 해상도는 끝납니다. C : windows installer {some-guid} python_icon.exe 예를 들어. 대부분의 사무실 프로그램에는이 문제도 있습니다.

CodeProject는 리버스 엔지니어링 LNK 형식으로 수행 된 또 다른 솔루션이 있습니다. http://www.codeproject.com/kb/shell/readlnkfile.aspx 그러나 그것은 사례에서는 작동하지 않습니다.

다른 방법이 있습니까?

이 C : Windows Installer 폴더는 무엇입니까? 그리고 이것은 무엇입니까 _icon.exe에 넣은 것은 무엇입니까?

도움이 되었습니까?

해결책

좋아, 여기서 솔루션을 찾았습니다. http://social.msdn.microsoft.com/forums/en-us/winformssetup/thread/2df18f93-77d8-4217-94a1-6cbe5333a6c4

이 LNK는 MSI LNK이므로 경로를 해결하기 위해 MSI 기능을 사용해야합니다.

TCHAR pc [50] = {0};
TCHAR feat [100] = {0};
TCHAR comp [50] = {0};
int b=MsiGetShortcutTarget("Python (command line).lnk",pc,feat,comp);

TCHAR pth [500] = {0};
DWORD chs = 500;
int i = MsiGetComponentPath (pc, comp, pth, &chs);

PTH 경로를 포함합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top