The time now is Fri 19 Oct 2018, 04:54
All times are UTC - 4
Joined: 24 May 2015
|Posted: Fri 13 Apr 2018, 14:17 Post subject:
Create Wine Menu Shortcuts to Portable Apps the Hard Way
Subject description: Creating windows .lnk files like a installer does it
The easy way: Create a .desktop file which will execute "wine /path/to/your/portable/app.exe"
But there's another way....
Prologue: I have never used wine before (I mean the app, just look at my name).
So a friend of mine gave me 2 windows apps to tryout.
One was needed to be installed first, another was a portable app so didn't need any installing to be done.
So I downloaded wine-3.0-i686-1.sfs from Fatdog's SFS Manager. And loaded it.
Then Installed the first software by executing it's install.exe through wine. It installed nicely and runs nicely too.
The other app runs too by executing it's .exe file through wine.
I noticed the install script of first program did create menu entries.
Main Menu > Wine > Programs > App1
This got me thinking.
Of course I knew "The Easy Way"
But I wanted to investigate how wine does it.
Well, I found out wine created windows .lnk files in /root/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu/Programs/ folder
And also .desktop file in /root/.local/share/applications/wine/Programs/ folder which executed the .lnk file (not the .exe file) (the Exec= line in that .desktop file contained a lot of backslashes, 3 where I would use only one).
For example, Exec=env WINEPREFIX="/root/.wine" wine C:\\\\windows\\\\command\\\\start.exe /Unix /root/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\\ Menu/Programs/FluidSim/FluidSim.lnk
So I searched for making .lnk files in linux.
After 4 hours of searching found something usefull, because most would only talk about "just use .desktop file", "you can't create/edit .lnk file it's a windows file".
Well sorting through all those negatives remarks and thread leading to nowhere I finally made following HowTo...
Finally coming to the point of this thread..... lol
1) Make a .lnk file pointing to your app's .exe
>a) Download the bash script from Here
This script makes .lnk files using hexdump I belive, more knowledgeable persons please comment.
The script has french comments, someone who knows french like Musher may translate them. (One more script to count musher, )
Copy this script to some place and make it executable
>b) Note down the "Windows" path to your portable app.
In my system / is seen as Z: drive and my app is on sda6.
So Path for me is Z:\mnt\sda6\Simulation\Pneumatic\bin\fl_sim_p.exe
Note the backslashes.
>c) Open terminal where you copied that script and run following command (Replace the "windows path to your app's .exe" with your path (keep the " " ) and "your apps name.lnk" with whatever your app is called)
|./mslink.sh -l "windows path to your app's .exe" -o "/root/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu/Programs/Your app's name.lnk"
2) Make .desktop file executing the .lnk you created
Run following command in a terminal. (see referance.)
|wine winemenubuilder -w "/root/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu/Programs/Your app's name.lnk" |
Done. You will see a menu entry in wine submenu for your app. Clicking on it will execute the windows portable app.
Sorry for long post for just 2 commands.
But I hope it shows my 4hrs of search (+half hour of writing this post. lol)
This should be handled by wine itself, maybe playonlinux handles this.
There's chance to further enhance the mslinks.sh, so that just pointing it to a .exe will make .lnk at proper place with proper windows path.
I also see some differences between .lnk files created by an installer and what we created if I run "strings" command on them.
But it's beyond my current limits, someone more knowledgeable may help.
Is this hard way necessary to follow???, .... nope, do whatever floats your boat.
Hope this helps.
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0753s ][ Queries: 12 (0.0250s) ][ GZIP on ]