How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Questions about Wine on Linux
Locked
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

Is possible to make WINE open an exe-file only by its name, but omitting the extension EXE?
I am running linux Manjaro, Xfce and I have application Simplicity Studio IDE from Silicon Labs, that uses WINE to build projects. It worked well in KDE, but after one crush I reinstalled clean the entire system and used Xfce instead of KDE. After that, WINE integration with the IDE stopped working with the error:

wine: failed to open “/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51”: c0000135
(the file is C51.EXE)
The Simplicity Studio IDE omits the extension EXE at the end and this is the cause of the error.
It didn’t cause this problem before in KDE, but now WINE can’t find the file without extension.

Is it possible to make WINE open an exe-file only by its name, but omitting the extension EXE?

Thank you.
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

If I run the exe-file within the folder, then WINE opens the file with extension omitted, without problems.
On Manjaro forum I was very much helped and suggested the following:

As workaround you can set the WINEPATH:
env WINEPREFIX=$HOME/.wine WINEPATH=$HOME/Downloads wine "binary_file"
invisible kid
Level 5
Level 5
Posts: 352
Joined: Tue Dec 24, 2019 3:23 pm

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by invisible kid »

Well one quick and dirty way to do it on a file-by-file basis is to go to the directory where the file is and create a symbolic link(a name of anything you want pointing to the actual file:

Code: Select all

ln -s C51.EXE C51

Code: Select all

ls -l C51
lrwxrwxrwx 1 username username 7 Jun  8 14:16 C51 -> C51.EXE
But there might be a more elegant/universal solution, just wanted to post this in case there isn't(I don't know).
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

Thank you @invisible kid, but I need "more elegant/universal solution", something that I was suggested on Manjaro forum, to use WINEPATH variable, that I am yet to understand.
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

I need to make wine run application only by its name without a exe-suffix.
fargodwe

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by fargodwe »

Did you try setting up the symbolic link as Invisible Kid showed? you SHOULD be able to run the exe without the exe externsion now. C51, via the link, should act the same as if you had said C51.exe - you don't need the exe.

Try that in a terminal window and post back the results.
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

Yes it works with symbolic link. Interesting fact is that if I switch to the folder where exe-file is located, so that no need for the full path, then I can run it without extension, like that: WINE FILENAME, and it works. If I rename the file by removing the extension, then WINE finds the file. My problem is that SimplicityStudio IDE generates Makefiles wich have many lines where WINE runs a file with a full path, and in all those lines exe-files have no extension. So, creating symbolic link or switching to the folder will not solve my problem.

Thank you
fargodwe

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by fargodwe »

And at each of those paths if you create a link there for that given object what happens? If it's generating <complete path>x, what happens when you put the link in <complete path> of x to x.exe for each of the paths and else's as needed?
Are you saying it builds the else's and tries to have wine execute them immediately afterwards without the extension??
fargodwe

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by fargodwe »

You might also have wanted to post that you already had a post in the simplicityStudio form and the reply given there. I suspect your problem isn't as simple as you think. Please provide a complete log file from running simplicity studio. Would Luke to see alk the lines it is generating and executing.
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

Thank you for your response.
This is the makefile IDE generates:

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

# Keil tools exit code 1 is warnings only, so don't treat as an error in make
RC := test $$? -lt 2

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include src/subdir.mk
-include subdir.mk
-include objects.mk

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables

# All Target
all: F36x_Blinky_4.omf

# Tool invocations
F36x_Blinky_4.omf: echo_path $(OBJS)
@echo 'Building target: $@'
@echo 'Invoking: Keil 8051 Linker'
wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/LX51" "@F36x_Blinky_4.lnp" || $(RC)
@echo 'Finished building target: $@'

# Change from all upper case to the expected case
@-mv "F36X_BLINKY_4.OMF.CRBUILD" "$@"

# Generate hex file: F36x_Blinky_4.hex
@wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/Ohx51" "F36x_Blinky_4.omf" "HEXFILE (F36x_Blinky_4.hex)" "H386" 2>&1 >/dev/null

# Other Targets
clean:
-$(RM) $(EXECUTABLES)$(OBJS) F36x_Blinky_4.omf
-@echo ' '

.PHONY: all clean dependents

-include ../makefile.targets
# echo the path
echo_path:
@echo PATH=$$PATH
@echo ' '

-----------------------------------------------------
These are the compilation/build/ results:
------------------------------------------------------

02:27:30 **** Build of configuration Keil 8051 vnull - Debug for project F36x_Blinky_4 ****
make all
PATH=/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN:/home/username/SimplicityStudio_v5/support/8051:/usr/bin:/home/username/SimplicityStudio_v5/support/common/build:/home/username/.local/bin:/usr/local/bin:/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin

Building file: ../src/F36x_Blinky.c
Invoking: Keil 8051 Compiler
wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51" "@src/F36x_Blinky.__i" || test $? -lt 2
wine: failed to open "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51": c0000135
make: *** [src/subdir.mk:21: src/F36x_Blinky.OBJ] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

02:27:42 Build Failed. 1 errors, 0 warnings. (took 11s.701ms)
fargodwe

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by fargodwe »

So I don't see anything that shows it building C51 so I have to assume it already existed. So, if you put the link in the /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN folder and then rerun the process you showed in your log what happens? I'm just an inexperienced person trying to help so I hope you don't mind if I ask a dumb question. Also, perhaps a list of the contents of

Code: Select all

 ls /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51

Code: Select all

ls  /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.exe
and perhaps

Code: Select all

ls  /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE
I'm curious as to what it is showing in that folder.
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

Thank you for your help.
These are the results from console:

[... ~]$ cd /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN

[... BIN]$ ln -s C51.EXE C51

[... BIN]$ ls -l C51
lrwxrwxrwx 1 username username 7 Jun 10 03:30 C51 -> C51.EXE

[... BIN]$ wine C51
C51 COMPILER V9.60.0.0 - SN: K1FPC-20EFSZ
COPYRIGHT Copyright (C) 2012 - 2019 ARM Ltd and ARM Germany GmbH. All rights res
erved.
...... it worked well

[... BIN]$ wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51"
wine: failed to open "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51": c0000135

[... BIN]$ wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.exe"
C51 COMPILER V9.60.0.0 - SN: K1FPC-20EFSZ
COPYRIGHT Copyright (C) 2012 - 2019 ARM Ltd and ARM Germany GmbH. All rights res
erved.
...... it worked well

[... BIN]$ cd ~
[... ~]$ wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51"
wine: failed to open "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51": c0000135

[..~]$ ls /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51
ls: cannot access '/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51': No such file or directory

[... ~]$ ls /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.exe
ls: cannot access '/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.exe': No such file or directory

[... ~]$ ls /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE
ls: cannot access '/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE': No such file or directory

[... ~]$ cd /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN

[... BIN]$ ls /home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE
ls: cannot access '/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE': No such file or directory

I am very grateful for your help.
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

I am sorry. Please, ignore the previous post.
I can't correct the previous post, but I didn't notice that that the link created was broken and in the rest of lines my real username was incorrect. I am very sorry.

Now it is correct:

[... BIN]$ ln -s C51.EXE C51
[....BIN]$ ls -l C51
lrwxrwxrwx 1 username username 7 Jun 10 08:18 C51 -> C51.exe

After that it works with the link:

[...BIN]$ wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51"

C51 COMPILER V9.60.0.0 - SN: K1FPC-20EFSZ
COPYRIGHT Copyright (C) 2012 - 2019 ARM Ltd and ARM Germany GmbH. All rights reserved.

[... ~]$ wine "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51"

C51 COMPILER V9.60.0.0 - SN: K1FPC-20EFSZ
COPYRIGHT Copyright (C) 2012 - 2019 ARM Ltd and ARM Germany GmbH. All rights reserved.

Also, your commands:

[... ~]$ ls "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51"
/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51
[... ~]$ ls "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.exe"
/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.exe
[... ~]$ ls "/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE"
ls: cannot access '/home/username/SimplicityStudio_v5/developer/toolchains/keil_8051/9.60/BIN/C51.EXE': No such file or directory

Thank you.
invisible kid
Level 5
Level 5
Posts: 352
Joined: Tue Dec 24, 2019 3:23 pm

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by invisible kid »

If you're compiling and such, could using something like Cygwin work/help?

https://www.cygwin.com/

As a matter of fact that is the first thing I thought of when the topic of extensions came up. Cygwin seems to have that all smoothed-over.

If not, good luck still!
Aizeq
Level 1
Level 1
Posts: 9
Joined: Tue Jun 08, 2021 3:25 am

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by Aizeq »

Hi invisible kid,

I used your advice and created a bunch of links as you suggested and it works. I can actually use the IDE. It's not exactly what I wanted, but I can use it now, at least for the existing projects. I still want to find more elegant solution. I have to read carefully what Cygwin can do. Thank you.

Tank you very much
invisible kid
Level 5
Level 5
Posts: 352
Joined: Tue Dec 24, 2019 3:23 pm

Re: How to make WINE open an exe-file only by its name, but omitting the extension EXE?

Post by invisible kid »

Cool!
Locked