GetExeName: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
Instructor (talk | contribs) No edit summary |
Instructor (talk | contribs) No edit summary |
||
Line 17: | Line 17: | ||
Get installer filename ( | Get installer filename (with valid case for Windows 9X/Me). | ||
Line 44: | Line 44: | ||
Push $0 | Push $0 | ||
System::Call 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024)' | |||
System::Call 'kernel32::GetLongPathNameA(t r0, t .r0, i 1024)' | |||
System::Call 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024) | |||
Exch $0 | Exch $0 | ||
FunctionEnd | FunctionEnd |
Revision as of 10:28, 23 July 2005
Author: Instructor (talk, contrib) |
Links
- Latest version of headers "nsh.zip"
- http://forums.winamp.com/showthread.php?s=&threadid=203228&goto=lastpost
If a function is used without header, put the function code in your script before calling it.
The Function Description
____________________________________________________________________________ GetExeName ____________________________________________________________________________ Get installer filename (with valid case for Windows 9X/Me). Syntax: ${GetExeName} $var
Example:
Section ${GetExeName} $R0 ; $R0="C:\ftp\program.exe" SectionEnd
The Function Code
Function GetExeName !define GetExeName `!insertmacro GetExeNameCall` !macro GetExeNameCall _RESULT Call GetExeName Pop ${_RESULT} !macroend Push $0 System::Call 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024)' System::Call 'kernel32::GetLongPathNameA(t r0, t .r0, i 1024)' Exch $0 FunctionEnd