Getting filename of the setup file itself

Got a problem you cannot solve? Try here.
pfennig
Posts: 168
Joined: Wed Nov 08, 2006 8:39 am

Getting filename of the setup file itself

Postby pfennig » Tue Aug 23, 2022 9:24 am

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.
Best regards
pfennig

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Postby FrancescoT » Wed Aug 24, 2022 6:51 am

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
Posts: 168
Joined: Wed Nov 08, 2006 8:39 am

Re: Getting filename of the setup file itself

Postby pfennig » Wed Aug 24, 2022 7:04 am

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.
Best regards

pfennig

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Postby FrancescoT » Wed Aug 24, 2022 10:58 am

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
Posts: 168
Joined: Wed Nov 08, 2006 8:39 am

Re: Getting filename of the setup file itself

Postby pfennig » Wed Aug 24, 2022 12:21 pm

pfennig wrote:$SETUPPATH$ results in the path of MySetup123.exe but without filename.

You see, I tried this before my initial post.
Best regards

pfennig

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Postby FrancescoT » Thu Aug 25, 2022 2:07 pm

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
Posts: 168
Joined: Wed Nov 08, 2006 8:39 am

Re: Getting filename of the setup file itself

Postby pfennig » Thu Aug 25, 2022 3:18 pm

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

pfennig

pfennig
Posts: 168
Joined: Wed Nov 08, 2006 8:39 am

Re: Getting filename of the setup file itself

Postby pfennig » Fri Aug 26, 2022 3:05 am

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
Best regards

pfennig

JohnGaver
Posts: 67
Joined: Mon Feb 05, 2024 6:15 pm

Re: Getting filename of the setup file itself

Postby JohnGaver » Sat Feb 24, 2024 12:56 pm

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.
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/installaware-multi-platform.htm

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Getting filename of the setup file itself

Postby FrancescoT » Tue Mar 12, 2024 5:38 pm

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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 47 guests