![]() |
#1 |
Junior Member
Join Date: Jun 2012
Posts: 9
|
![]()
I want the NSIS installer search and automatically get the exe file in the target system and needs to execute, Whether it is possible? , If possible please post the code..........
![]() |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
You can use the Locate plugin to find a file on the target system. Note that there's no guarantee that 'your' filename isn't used by some other application as well, so... Use with caution. Maybe add an md5 hashcheck or something?
|
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jun 2012
Posts: 9
|
can you give correct code for that I want to use that , I cant understand locate plugin
![]() ![]() |
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
To learn NSIS, start with examining NSIS\Examples\Example1.nsi and Example2.nsi. Find out what all commands do, using the command reference: http://nsis.sourceforge.net/Docs/Chapter4.html
Once you know what all the commands in those Examples do, and why, you will be well on your way to understanding NSIS. In your particular case, you can find the required code in the locate plugin zip (Example\LocateTest.nsi). |
![]() |
![]() |
![]() |
#5 |
Major Dude
|
Locate plug-in is here (wiki): http://nsis.sourceforge.net/Locate_plugin, forum thread here: http://forums.winamp.com/showthread....hreadid=224837
There are many examples, try to use one of them. Cool looking installers with custom design: www.graphical-installer.com Create Setup Pages easily: www.install-designer.com Build installers in Visual Studio 2005-2019: www.visual-installer.com or RAD Studio 2009, 2010, XE-10.4 Sydney: www.rad-installer.com |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Jun 2012
Posts: 9
|
please any one can send locate plugin to my mail ID cgssankar@gmail.com because I can't able do download from source.....
![]() |
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
It's working fine: http://nsis.sourceforge.net/mediawik.../af/Locate.zip
If you can't download zip files at your work location, you won't be able to download it from gmail either. |
![]() |
![]() |
![]() |
#8 |
Junior Member
Join Date: Jun 2012
Posts: 9
|
I placed the required files for locate command in the application path and when I compile the following code,
Name "filefind" OutFile Files.exe !include "Locate.nsh" Section ${Locate} "final/jre" "/L=F /M=jre1.exe" "Example1" ; 'RPC DCOM.rar' file in 'C:\ftp' with size 1 Kb or more IfErrors 0 +2 MessageBox MB_OK "Error" IDOK +2 MessageBox MB_OK "$$R0=$R0" SectionEnd Function Example1 StrCpy $R0 $R9 ; $R0="C:\ftp\files\RPC DCOM.rar" MessageBox MB_YESNO '$R0$\n$\nFind next?' IDYES +2 StrCpy $0 StopLocate Push $0 FunctionEnd I got the error "Invalid command: ${locate}", Now what can I do? ![]() |
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: Oct 2006
Posts: 1,892
|
There is no "Locate" define in locate.nsh. Look at the example again.
|
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Jun 2012
Posts: 9
|
I want to find jre.exe file which is in *\final\jre directory for that I am using the following section,
Section "Search for exe files" ${locate::Open} "*\final\jre" `/L=F /D=0 /M=*.exe /B=1` $0 StrCmp $0 0 0 loop MessageBox MB_OK "Error" IDOK close loop: ${locate::Find} $0 $1 $2 $3 $4 $5 $6 MessageBox MB_OKCANCEL '$$1 "path\name" =[$1]$\n\ $$2 "path" =[$2]$\n\ $$3 "name" =[$3]$\n\ $$4 "size" =[$4]$\n\ $$5 "time" =[$5]$\n\ $$6 "attributes =[$6]$\n\ $\n\ Find next?' IDOK loop close: ${locate::Close} $0 ${locate::Unload} SectionEnd but every time i got Error message only. can you give a correct syntax to get that exe file?........... ![]() |
![]() |
![]() |
![]() |
#11 |
Major Dude
|
Syntax of "Path" parameter is incorrect.
You cannot use "*\final\jre directory" but you need absolute path like "D:\Temp|C:\WINDOWS", ... Read readme file, there is correct usage. Cool looking installers with custom design: www.graphical-installer.com Create Setup Pages easily: www.install-designer.com Build installers in Visual Studio 2005-2019: www.visual-installer.com or RAD Studio 2009, 2010, XE-10.4 Sydney: www.rad-installer.com |
![]() |
![]() |
![]() |
|
Tags |
automatically, get exe, search, with out set path |
Thread Tools | Search this Thread |
Display Modes | |
|
|