Getting filename of the setup file itself

Got a problem you cannot solve? Try here.
Post Reply
pfennig

Getting filename of the setup file itself

Post 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.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Post by FrancescoT »

You may try:

Code: Select all

Set Variable SETUP_FILENAME to $EXEDIR$
Extract File Name Only: SETUP_FILENAME
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
pfennig

Re: Getting filename of the setup file itself

Post 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.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Post 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.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
pfennig

Re: Getting filename of the setup file itself

Post by pfennig »

pfennig wrote: $SETUPPATH$ results in the path of MySetup123.exe but without filename.
You see, I tried this before my initial post.
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Post 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.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
pfennig

Re: Getting filename of the setup file itself

Post by pfennig »

Yes, thank you, this is the one I was looking for.
pfennig

Re: Getting filename of the setup file itself

Post 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
JohnGaver
Posts: 265
Joined: Mon Feb 05, 2024 6:15 pm

Re: Getting filename of the setup file itself

Post 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:

http://www.installaware.com/mh52/deskto ... 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.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installawa ... atform.htm
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Post 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.
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply