Archive: Get Installer's filename (archive)


Get Installer's filename (archive)
I read this article in the archive. It's okay but maybe it's time for a built-in $EXENAME var or something like this? Could make life easier. ;)

What do you think about?

Mathias.


Maybe calling this API using the System plug-in would be the best solution:

http://msdn.microsoft.com/library/de...lefilename.asp


Maybe it is, Joost. But if that is an argument, you also could remove the other built-in variables. ;) Why should I use $WINDIR (for example) if I could call the API "GetWindowsDirectory"?

I just thought it could be easier. Need your setup's name? Just call $EXENAME in your script.

However, now I'm afraid to ask for shift operators (<< >>) (IntOp). I could use them to get the Windows version and type (s. API "GetVersion") :)


Mathias.


http://nsis.sourceforge.net/site/ind...5&tx_faq_faq=7

If we add a variable/command for everything that can also be done using plug-ins or the script language, NSIS will become huge.

$WINDIR is something that many people need, getting the filename of the installer not.


Originally posted by Joost Verburg

If we add a variable/command for everything that can also be done using plug-ins or the script language, NSIS will become huge.
Yes, you're right.

$WINDIR is something that many people need, getting the filename of the installer not. [/B]
I can accept this statement. :)

I just made a suggestion because I try to work as simple as possible. Do you know what I mean? Maybe I have the knowledge to do some gimmicks with the script language or an external plug-in. But in the most situations I try to avoid it. And the easiest way to use something special is always a built-in feature.

That was the intention. But however, it's okay. :)

Mathias.

But if you only use the same plugin for all, will only add once the plugin size. For Example, using System Plugin do get the current time, and to use the clipboard to get a string.


Yes, I know it. But as I said, it was not the reason, I wrote this here.

Mathias.


just for information, how much would nsis grow adding $EXENAME or $SENDTO or whatever?

also, how much size or memory do the new unlimited variables feature take?


This new variable feature has been highly optimized and doesn't add more than a few hundred bytes.

Adding once of these not commonly used features would not make a big difference, but there are a lot of things that can also be done using the script language. If we would add 'em all, NSIS would become huge.


Can this help you?


OutFile "EXEname.exe"
Name "Get a Installer's EXE name"
Caption "Get a Installer's EXE name"
XPStyle "on"

Function ".onInit"
System::Call 'kernel32::GetModuleFileNameA(i 0, t .r0, i 1024) i r1'
MessageBox MB_OK|MB_ICONINFORMATION "$0"
Quit
FunctionEnd

Section "-boo"
;
SectionEnd

Joost Verburg, thanks for the explanation :)