Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   manualy search for a file? (http://forums.winamp.com/showthread.php?t=248191)

Appolonius 8th June 2006 17:35

manualy search for a file?
 
I have made an Installer that installs 2 files. I also need the installer to Let me search for a desktop shortcut (will not always have the same name), and change the target of that shortcut to one of the 2 files I installed.

CancerFace 8th June 2006 17:46

You could use the locate plugin ...
CF

Instructor 8th June 2006 18:56

Updated code from this thread
code:
Name "Output"
OutFile "Output.exe"

!include "Locate.nsh"

!include "FileFunc.nsh"
!insertmacro GetFileName

Section
StrCpy $R0 "MyProgram.exe" #File name of the application

${locate::Open} "$DESKTOP|$QUICKLAUNCH|$SMPROGRAMS" "/F=1 /D=0 /M=*.lnk /B=1" $0
StrCmp $0 0 0 nextlocate
MessageBox MB_OK "Error" IDOK endlocate

nextlocate:
${locate::Find} "$0" $1 $2 $3 $4 $5 $6

StrCmp $6 '' endlocate
ShellLink::GetShortCutTarget $1
Pop $7
${GetFileName} "$7" $7

StrCmp $7 $R0 0 nextlocate
Delete $1
goto nextlocate

endlocate:
${locate::Close} "$0"
${locate::Unload}
SectionEnd



All times are GMT. The time now is 04:43.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.