Page 1 of 1

Getting filename of the setup file itself

Posted: Tue Aug 23, 2022 9:24 am
by pfennig
Assuming InstallAware created a single file setup file with the name MySetup.exe.
Later this file will be renamed to MySetup123.exe.

Is it possible, to retrieve this new name during the installation process and use it in a variable?

$EXEFILE$ delivers C:\ProgramData\mia*.tmp\MySetup.exe
$SETUPPATH$ results in the path of MySetup123.exe but without filename.

Re: Getting filename of the setup file itself

Posted: Wed Aug 24, 2022 6:51 am
by FrancescoT
You may try:

Code: Select all

Set Variable SETUP_FILENAME to $EXEDIR$
Extract File Name Only: SETUP_FILENAME

Re: Getting filename of the setup file itself

Posted: Wed Aug 24, 2022 7:04 am
by pfennig
That's what I did.

The result is MySetup, becaue the unpackaged file in C:\ProgramData\mia*.tmp\ has the original name. I want the name of my renamed file MySetup123.

Since the pre-defined variable SETUPPATH correctly results in the path of my renamed MySetup123.exe, it should be possipple to get MySetup123.exe or MySetup123 as well.

Re: Getting filename of the setup file itself

Posted: Wed Aug 24, 2022 10:58 am
by FrancescoT
Yes, using the above approach but on "SETUPPATH" (in place of EXEDIR) you should be able to get the name of your renamed file.

Re: Getting filename of the setup file itself

Posted: Wed Aug 24, 2022 12:21 pm
by pfennig
pfennig wrote:$SETUPPATH$ results in the path of MySetup123.exe but without filename.

You see, I tried this before my initial post.

Re: Getting filename of the setup file itself

Posted: Thu Aug 25, 2022 2:07 pm
by FrancescoT
Try with "SFXFILE" pre-defined variable.
SFXFILE: If an uncompressed directory layout is used, this variable is empty. Otherwise set to the file name of the self extracting executable which bootstrapped the installer.


I just tried it and it returns the file name of the self extracting exe (as it is).

Hope this helps you.

Re: Getting filename of the setup file itself

Posted: Thu Aug 25, 2022 3:18 pm
by pfennig
Yes, thank you, this is the one I was looking for.

Re: Getting filename of the setup file itself

Posted: Fri Aug 26, 2022 3:05 am
by pfennig
I have to take that back :(

$SFXFILE$ results in the correct filename only when the setup executable locates on a local drive. Starting it from a network drive, e.g. a NAS, it gets garbled.

local - myglasstest_2211.exe
network - muqsfh~q.exe

Re: Getting filename of the setup file itself

Posted: Sat Feb 24, 2024 12:56 pm
by JohnGaver
This topic applies to InstallAware Multi Platform as well.

Are you reporting a bug with some of the pre-defined variables at play here:

www.installaware.com/mh52/desktop/prede ... iables.htm

$SETUPPATH$ is really the most top-level variable at play.

But if $SFXFILE$ and/or $SFXPATH$ are corrupt, I can't see that working properly either.

Did you also have a chance to look at $GPOPATH$?

If you could let me know which work properly on network paths, I'll then escalate this to R&D for priority actioning.

Re: Getting filename of the setup file itself

Posted: Tue Mar 12, 2024 5:38 pm
by FrancescoT
I did a try and I don't see any problem with the value returned by the variables; SETUPPATH, SFXFILE, SFXPATH, and GPOPATH. For what I see all these variables work as documented.

However, if you believe there is a problem, please provide a very minimal project that demonstrates the issue.