![]() |
#1 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
![]()
I have thought
![]() Word Functions Header v2.52 Text Functions Header v1.4 File Functions Header v1.21 1. Function GetParameters moved from WordFunc.nsh to FileFunc.nsh 2. Text Functions LineFind and LineRead -now last line "-1" instead of "0" These headers are included with NSIS. See: http://nsis.sourceforge.net/Docs/AppendixE.html#E Last edited by Instructor; 28th December 2004 at 14:02. |
![]() |
![]() |
![]() |
#2 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.6
Text Functions Header v1.4 File Functions Header v1.3 1. "GetDrives" v1.1 -Fixed: depended on drives order 2. "WordFind2X" v2.1 -Loops sorted 3. New: "WordFind3X" v1.0 -Find word, that contain string, between two delimiters. (Based on Afrow UK idea of Function "StrSortLR" 2003-06-18) 4. "WordFuncExample.nsi" updated. |
![]() |
![]() |
![]() |
#3 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.6
Text Functions Header v1.5 File Functions Header v1.3 "LineFind" v1.3 -Added "/NUL" option: No output text file (only read InputFile). |
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.6
Text Functions Header v1.5 File Functions Header v1.4 1. New: "GetBaseName" -Get file name without extension. (Based on comperio idea of Function "GetBaseName" 2005-01-28) 2. New: "GetFileVersion" -Gets the version information from executable file. 3. New: "VersionCompare" v1.0 -Compare version numbers. (Based on Afrow UK Function "VersionCheckNew2" 2005-01-24) His original function isn't included because of wrong results: ${VersionCheckNew2} "2.5.9" "2.5.01" $R0 -Ver2 newer ${VersionCheckNew2} "2.5.09" "2.5" $R0 -equal |
![]() |
![]() |
![]() |
#5 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Why is 2.5.09 equal to 2.5? Just a typo or does the function behave that way?
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#6 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
No. It isn't a typo.
|
![]() |
![]() |
![]() |
#7 | |
Major Dude
|
@kichik:
Quote:
![]() hand by comm@nder21 ---------- WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility |
|
![]() |
![]() |
![]() |
#8 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Thanks for letting me know
![]() Fixed my function. -Stu |
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.6
Text Functions Header v1.6 File Functions Header v1.4 1. "LineFind" v1.4 -Output file will not be updated if no changes made -Error flag if output file path isn't exists -Added: "{No}" callback this line and don't write others -Variables in callback function changed 2. Added script to simple install WordFunc.nsh, TextFunc.nsh, FileFunc.nsh Last edited by Instructor; 21st March 2005 at 08:48. |
![]() |
![]() |
![]() |
#10 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.7
Text Functions Header v1.7 File Functions Header v1.5 1. "ClbSet", "ClbGet" removed from WordFunc.nsh 2. "LineRead" v1.2, "LineSum", "FileJoin" v1.4, "TextCompare" v1.2 -Added IfErrors after FileOpen 3. "GetDrives" v1.2 -Added "ALL" along with "" 4. New: "FileReadFromEnd" v1.0 -Read text file from end line by line. 5. New: "DriveSpace" v1.0 -Get total, occupied or free space of the drive. 6. Added: "GetRoot" (Based on KiCHiK Function "GetRoot") -Get the root directory. 7. Added: "GetParent" (Based on sunjammer Function "GetParent") -Get parent directory. 8. Added: "GetFileName" (Based on KiCHiK Function "GetFileName") -Get last part from directory path. 9. Many minor code and documentation improvements Last edited by Instructor; 26th March 2005 at 21:25. |
![]() |
![]() |
![]() |
#11 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.7
Text Functions Header v1.7 File Functions Header v1.6 "DriveSpace", "DirState", "GetFileVersion" -Missing ClearErrors at the beginning. |
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.7
Text Functions Header v1.8 File Functions Header v1.7 In order to avoid exiting from connected functions, changed exit value in callback function to "Stop<FunctionName>": -"LineFind" Stop -> StopLineFind -"FileReadFromEnd" Stop -> StopFileReadFromEnd -"TextCompare" StopCompare -> StopTextCompare -"GetDrives" Stop -> StopGetDrives Last edited by Instructor; 28th March 2005 at 13:25. |
![]() |
![]() |
![]() |
#13 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.8
Text Functions Header v1.8 File Functions Header v1.8 1. "Locate" v1.5 -Added "/B=" parameter (when used banner with function) 2. "StrFilter" v1.2 -Missing ClearErrors at the beginning. |
![]() |
![]() |
![]() |
#14 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.8
Text Functions Header v1.8 File Functions Header v1.9 Changes: "Locate" v1.6 -Fixed: if error appeared in the callback, function don't restore stack after exit. |
![]() |
![]() |
![]() |
#15 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.8
Text Functions Header v1.8 File Functions Header v2.0 Changes: New: "GetOptions" -Get options from command line parameters. |
![]() |
![]() |
![]() |
#16 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v2.9
Text Functions Header v2.0 File Functions Header v2.3 Changes: 1. Verbosity added (faster compilation time) 2. "Locate" v1.7 -Fixed: Banner support 3. "GetOptions" -Now required only 2 arguments: ${GetOptions} "[Parameters]" "[Option]" $var 4. "GetTime" v1.2 -Now convert day and month in DD and MM format 5. "TextCompare" v1.4 -Rewrited all code 6. "FileReadFromEnd" v1.2 -Now if the text file cannot be opened, the error flag is set |
![]() |
![]() |
![]() |
#17 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.0
Text Functions Header v2.1 File Functions Header v2.4 Changes: 1. "VersionCompare" moved from FileFunc.nsh to WordFunc.nsh 2. New: "VersionConvert" v1.0 -Convert version in the numerical format which can be compared. 3. New: "ConfigRead" v1.0 -Read value from entry name in config file. 4. New: "ConfigWrite" v1.1 -Write value from entry name in config file. 5. New: "FileRecode" -Recode text file from DOS to Windows format and vice-versa. 6. New: "GetFileAttributes" v1.1 -Get attributes of file or directory. 7. New: "BannerTrimPath" -Trim string path for banner. |
![]() |
![]() |
![]() |
#18 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.0
Text Functions Header v2.1 File Functions Header v2.5 Changes: 1. "GetDrives" v1.4 -Fixed: Alloc/Free (Thanks nechai) 2. "GetOptions" -Better option search (complite ignoration in quotes) 3. Renamed example scripts (like in CVS): ...FuncTest.nsi -> ...Func.nsi ...FuncTest.ini -> ...Func.ini |
![]() |
![]() |
![]() |
#19 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.0
Text Functions Header v2.1 File Functions Header v2.6 Changes: 1. "GetTime" v1.3 -Fixed: Free structures 2. "GetExeName" and "GetExePath" -Simplification with "GetLongPathNameA" 3. "BannerTrimPath" -Added D mode |
![]() |
![]() |
![]() |
#20 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.1
Text Functions Header v2.1 File Functions Header v2.7 Changes: 1. "WordReplace" v2.1 -Fixed: Incorrect rule for return errorlevel 1 in situation when string beginning with word to replace and its only one word in string and when uses option - deletes all founded words (thanks hemancuso) 2. "GetExeName" and "GetExePath" -Fixed: Return empty string in Windows 95 (thanks kichik) |
![]() |
![]() |
![]() |
#21 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.1
Text Functions Header v2.1 File Functions Header v2.8 Changes: 1. Now "GetRoot" returns not only root drive or UNC: ${GetRoot} "Program Files\NSIS" $R0 # $R0="Program Files" instead of "" ${GetRoot} "\Program Files\NSIS" $R0 # $R0="\Program Files" instead of "" 2. Some typos corrected (thanks Jamyn) |
![]() |
![]() |
![]() |
#22 |
Guest
Posts: n/a
|
What about UTC (Coordinated Universal Time?)
I need to use UTC (Coordinated Universal Time) instead of Local Time which can be gotten from kernel32::GetSystemTime. Any chance of updating the "official" version of Text Functions Header to incorporate that functionality?
My other option is to hack GetTime() and include it directly in my code. Yuck. |
![]() |
![]() |
#23 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.1
Text Functions Header v2.1 File Functions Header v2.9 Changes: "GetTime" v1.4 -Added support for system time (UTC) -Added example how to convert time to 12-hour format AM/PM |
![]() |
![]() |
![]() |
#24 |
Senior Member
Join Date: Jul 2003
Posts: 152
|
Has the getdrives function been tested on windows 98,
If so does it work? |
![]() |
![]() |
![]() |
#25 | ||
Major Dude
Join Date: Jul 2004
Posts: 671
|
Quote:
Quote:
![]() |
||
![]() |
![]() |
![]() |
#26 |
Senior Member
Join Date: Jul 2003
Posts: 152
|
Thanks
|
![]() |
![]() |
![]() |
#27 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.2
Text Functions Header v2.2 File Functions Header v3.0 Changes: 1. "WordReplace" v2.2 -Added options "{", "}", "{*", "}*" 2. "GetOptions" -Now sets error flag if option does not found 3. "ConfigRead" -Now sets error flag if entry does not found 4. New case sensitive functions (NSIS 2.14 required): "WordFindS", "WordFind2XS", "WordFind3XS", "WordReplaceS", "WordAddS", "WordInsertS", "StrFilterS", "TextCompareS", "ConfigReadS", "ConfigWriteS", "GetOptionsS" 5. Added program for simple headers install |
![]() |
![]() |
![]() |
#28 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Word Functions Header v3.2
Text Functions Header v2.3 File Functions Header v3.1 Changes: -Added /NOUNLOAD flag for the system plugin. Functions that uses system plugin calls several times, now 25-75% faster ("GetSize", "DriveSpace", "GetDrives", "GetTime", "ConfigWrite", "FileRecode"). |
![]() |
![]() |
![]() |
#29 |
Major Dude
|
kichik, plz update the CVS
![]() hand by comm@nder21 ---------- WiKi pages:CreateInternetShortcut|Enhanced FindWindow|Parse CSV-Data|Open/Close CD-Drive|Installer without Icon|Vista application compatibility |
![]() |
![]() |
![]() |
#30 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
Hey Instructor,
I have to say that your functions are very cool. I find that I use them almost every chance I get! Here's an enhancement suggestion for the Locate function: Currently, there is an option /M=[mask] to add options of what to search for. A cool option might be something like /!M=[mask] to specify what to EXCLUDE. For example /!M=*.EXE would mean to exclude all dat files from the search. Using both together, one might use /M=*.DAT /!M=doofus.dat which would translate to: "Include all *.DAT files except the file named 'doofus.dat'" That's all I have for now. Keep up the great work! ![]() |
![]() |
![]() |
![]() |
#31 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Many filters implemented in Locate plugin
|
![]() |
![]() |
![]() |
#32 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
Thanks for the link, Instructor. Looks exactly what I was looking for!
So tell me, why is this not included with NSIS itself like you've your other functions? (Just curious) |
![]() |
![]() |
![]() |
#33 | |
Major Dude
Join Date: Jul 2004
Posts: 671
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#34 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
OK, I found an odd problem:
I'm using the Locate function from NSIS ver 2.15. I'm using it to search for all files/directies. I found that if I push two items to the stack, then locate will stop. But, if I just push one item to the stack, it works as expected. I also noticed that when i push the text "blah" to the stack the 2nd time (instead of "continue"), I get a Windows error. Here's a short sample showing the error: code: Is this an NSIS error or a problem with ${locate}? |
![]() |
![]() |
![]() |
#35 |
Major Dude
Join Date: Jul 2004
Posts: 671
|
You can not use NSIS stack in the callback function, because it is used by function. Only one push requered in the callback.
P.S. You can call another function from the callback, on condition that this function don't change the stack after completion. Last edited by Instructor; 9th March 2006 at 16:50. |
![]() |
![]() |
![]() |
#36 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
hmmm... I see. I'll have to keep that in mind.
I didn't see this this info in the NSIS manuals. Are you the one that manages those, or do I need to post a separate request on the NSIS sourceforge site? |
![]() |
![]() |
![]() |
#37 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
*sigh*
![]() I may have opened a big can of worms with this. In my example script above, I changed the sample script above to write the file names to a text file instead of pushing to the stack using the command FileWrite $myHandle "$R7$\r$\n". (my hope was to bypass the stack completely and then retrieve the values one at a time later.) Unfortunately, I find that it didn't work, either. ![]() However, using a WriteIniStr command WriteIniStr "$myFileName" "General" "$R7" "" did work, so I guess I have a workaround. But, I'd still like to understand why the FileWrite did not work. My only guess is that some NSIS functions (like FileWrite) must also use the NSIS stack. Is this correct? (If so, would perhaps using regular variables work better?) |
![]() |
![]() |
![]() |
#38 | |
Major Dude
Join Date: Jul 2004
Posts: 671
|
See example in manual "Write results to a text file"
Quote:
Last edited by Instructor; 10th March 2006 at 04:20. |
|
![]() |
![]() |
![]() |
#39 |
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
Thanks, Instructor. As always, your suggestion worked perfectly!
(I guess I can just chalk this up as a bad day.) ![]() |
![]() |
![]() |
![]() |
#40 |
Guest
Posts: n/a
|
Hi. I test this:
${VersionCompare} "2.3" "2.29" $0 And it tells me that $0 is 2. That means that 2.29 is a higher version than 2.3, which is wrong. Same goes with: ${VersionCompare} "2.29" "2.3" $0 it tells me that $0 is 1. I'll try to fix it, but I'm a newbie in NSIS... |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|