|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
|
#1 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Is it possible to locate a file from version information property?
well, here is the scenario. I want to check a target machine if "myapp.dll" is installed and update it if needed with new one. Some strange user for some strange reason has renamed "myapp.dll" in "another.dll". As far as I know by any documented way, there is not way to search and locate the file. My question is, could be possible to search all files in a dir looking at version information property tab? For example in description or in comments or in original file name? Is it possible for someone to grab such info?
Note that the file is not shared or self registered etc so there are not any info in registry. P.S. OK, someone would say that the above is useless in real world. It is just a study affair. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Oct 2005
Posts: 189
|
Have you looked into http://nsis.sourceforge.net/wiki/MD5_plugin ?
|
|
|
|
|
|
#3 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
That there ^^ is your best solution.
Iterate through the files with FindFirst, FindNext, FindClose and compare each found files' MD5 checksum with a hardcoded checksum in a !define of the particular dll file that you are after. Obviously though if there are a lot of dll files in the folder it could take a while. If this is the case you could get a count of the files in the directory first and show a progress banner with the Banner plugin. -Stu |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Jul 2004
Posts: 671
|
MD5 plugin usedcode: |
|
|
|
|
|
#5 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Thank you all!
i would say that the best reason why one should use NSIS is the instant and detailed feedback from the community. As I am examining the above by instructor I am able to find any file that I am looking for. Therefore, I understand that the conclusion is that it is not possible to grab details from the version information property tab. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
It probably is possible, but using an MD5 would be a better solution as an MD5 checksum is unique to every non-identical file.
-Stu |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Sep 2004
Location: Nottingham
Posts: 263
|
I guess the only problem is that that's probably the least scaleable solution possible
|
|
|
|
|
|
#8 | |
|
Major Dude
Join Date: Mar 2003
Posts: 571
|
Quote:
http://nsis.sourceforge.net/MoreInfo_plug-in |
|
|
|
|
|
|
#9 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
well, MoreInfo plug-in is not the case since it requires a specific file name in the filename parameter, thereby it is useless on the above scenario.
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#10 |
|
Member
Join Date: Feb 2006
Location: Germany
Posts: 53
|
Red Wine,
please see the example code from Instructor, the same method can be used with the MoreInfo plugin, just iterate through all the files matching your search filter. So it's not useless
|
|
|
|
|
|
#11 | |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Quote:
Could you please set up an example just like the way Instructor did? Thanks in advance Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
$R9 is the dll path and name.
-Stu |
|
|
|
|
|
#13 |
|
Member
Join Date: Feb 2006
Location: Germany
Posts: 53
|
Red Wine:
See Instructors code above, do you see the LocateCallback function? That is where all the work takes place. This function gets called for each file that matches the search pattern. Now, instead of code: just use any suitable function from the MoreInfo plugin. $R9 contains the full path and filename of the file found. I am too lazy to make up some sample code now, as I am still chewing on strange skinning effects, but I am sure you can figure it out now ![]() If not, please ask again and I'll whip up some sample code. |
|
|
|
|
|
#14 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
I think I'll figure it out now, thanks.
BTW examining some of the above I made a kind of auto creation for MD5 checksums. Please take a look. Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#15 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
It took me a while, though, I figured out how it works.
With the compination of Locate and MoreInfo plug-in is possible to find any file in a target without the need to provide the file name nor the exact file size. All it needs is the file extension and the info from a supported by MoreInfo plug-in field. code: Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#16 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
According to my quest for the given above scenario I had to navigate through the maze of several NSIS plugins and headers. The benefit is that I got my self a little deeper inside NSIS scripting and being able to make a fancy gui frontend for the md5dll. As far as I'm testing it on my XP-SP2 system I can't find any noteworthy bug. I'd like to kindly request the community to examine it and drop me a note if there is any.
The NSIS script: code: The InstallOptions INI: code: Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|