Hi everyone!
I'm a recent linux user starting my first steps with this powerfull OS, and so far I've been able to make my way through installing and configuring a basic box connected to a M$ network.
Now I'm trying to create a shortcut to run my windows database application in wine but so far I had no success...
To correctly start my application in M$ windows I need to create a shortcut pointing to my.exe "c:\myfolder\my.exe" and then fill in the "Start in" field with something like "\\myserver\serverfolder\" which is where my exe loads it's forms.
Aside some permission troubles, which are now solved, I was able to run this setup successfully in KDE using the "work path" field in launcher's properties.
The problem is that now I'm using gnome and there's no such field in launcher's properties.
Could someone please enlight my path?
Thanks in advance!
Problem creating shortcut
Re: Problem creating shortcut
Write a shell script that cds to the correct directory and starts the program, and point the launcher at that.MindGap wrote: Aside some permission troubles, which are now solved, I was able to run this setup successfully in KDE using the "work path" field in launcher's properties.
The problem is that now I'm using gnome and there's no such field in launcher's properties.
Could someone please enlight my path?
Re: Problem creating shortcut
Hi dimesio and thank you for your reply!dimesio wrote:Write a shell script that cds to the correct directory and starts the program, and point the launcher at that.MindGap wrote: Aside some permission troubles, which are now solved, I was able to run this setup successfully in KDE using the "work path" field in launcher's properties.
The problem is that now I'm using gnome and there's no such field in launcher's properties.
Could someone please enlight my path?
From your sugestion I realised it was possible to mount the network share, cd into it and launch wine from there. I tried that and it worked!
Now I'm working on making the mount permanent and creating the script, which I confess is going to be a major pain in the *** because I've never made one before.
I believe the script should be someting like this but i'm unsure of the correct syntax:
cd /mounted_share
wine my_exe form_name db_login/db_pass@db_sid
(this is exactly the way I call my application in windows)
Could you be so kind to help me with the script?
Thanks in advance!
Problem creating shortcut
On Fri, 2010-05-21 at 12:00 -0500, MindGap wrote:
================== start of my_exe_script ========================
#!/bin/bash
#
# If you're using a separate wine_prefix for this application
# include the following line where .wine_my_exe is the prefix name
#
export WINEPREFIX="~/.wine_my_exe
cd /mounted_share
wine my_exe form_name db_login/db_pass@db_sid
=================== end of my_exe_script =========================
After you've made the script, run the command "chmod u+x my_exe_script"
to make it executable and try it out by typing "my_exe_script" on the command line.
Then you can create a launcher that references your script, assign a
suitable icon and you're done.
In addition its a good idea to:
1) create a directory called 'bin' in your login directory
2) put the script there
3) edit .bash_profile adding the line:
export PATH=.:$HOME/bin:$PATH
4) logout and login again
This gives you a place, $HOME/bin , to put your script(s) in and
includes it in your user's search path.
Martin
Try something like this:dimesio wrote:Hi dimesio and thank you for your reply!MindGap wrote:Write a shell script that cds to the correct directory and starts the program, and point the launcher at that.Aside some permission troubles, which are now solved, I was able to run this setup successfully in KDE using the "work path" field in launcher's properties.
The problem is that now I'm using gnome and there's no such field in launcher's properties.
Could someone please enlight my path?
Now I'm working on making the mount permanent and creating the script, which I confess is going to be a major pain in the *** because I've never made one before.From your sugestion I realised it was possible to mount the network share, cd into it and launch wine from there. I tried that and it worked!
I believe the script should be someting like this but i'm unsure of the correct syntax:
================== start of my_exe_script ========================
#!/bin/bash
#
# If you're using a separate wine_prefix for this application
# include the following line where .wine_my_exe is the prefix name
#
export WINEPREFIX="~/.wine_my_exe
cd /mounted_share
wine my_exe form_name db_login/db_pass@db_sid
=================== end of my_exe_script =========================
After you've made the script, run the command "chmod u+x my_exe_script"
to make it executable and try it out by typing "my_exe_script" on the command line.
Then you can create a launcher that references your script, assign a
suitable icon and you're done.
In addition its a good idea to:
1) create a directory called 'bin' in your login directory
2) put the script there
3) edit .bash_profile adding the line:
export PATH=.:$HOME/bin:$PATH
4) logout and login again
This gives you a place, $HOME/bin , to put your script(s) in and
includes it in your user's search path.
Martin
Hey, I thought I'd add my two-cents.
That's the script I use to make wine shortcuts. It can be used for other things as well. It follows the syntax:
shortcut-maker <directory (can be relative path, as readlink converts it)> <command to execute> <target name>
It creates a shortcut with the "target name" in the /usr/local/bin folder. It makes it executable (do not that I have r+w permissions to this folder).
Basically, since, in Ubuntu, /usr/local/bin is in the path, I'm safe with this. For wine apps, I can do (imagine I want to launch myApp.exe in the current directory):
Or, to set WINEDEBUG=-all:
It can be used for many other things. Probably it has errors and it isn't well-written or that efficient, but it does the job for me. Oh, I almost forgot! It creates a shortcut that accepts parameters to pass to the app. So running "myapp-launcher --some-options" would be the same as "WINEDEBUG=-all wine MyApp.exe --some-options" (after CD'ing).
Hope that helped!
Cheers,
Jorl17
Code: Select all
#!/bin/bash
#Shortcut-Maker by Jorl
#Helper colors
NO_COLOUR="\e[0m"
LIGHT_BLUE="\e[1;34m"
RED="\e[1;31m"
#Test that there are three arguments (Path, Command and Name)
if [ -z $3 ]
then
echo -e "${RED}Not enough arguments!${NO_COLOUR}";
exit ;
fi ;
#The path must be resolved in case it is a symbolic link or relative
CDPATH=`readlink -f $1`
#Notify the user of what we are doing
echo -e "${LIGHT_BLUE}Creating shortcut...${NO_COLOUR}";
echo -e "${LIGHT_BLUE}Path: $CDPATH${NO_COLOUR}";
echo -e "${LIGHT_BLUE}Command: $2${NO_COLOUR}";
echo -e "${LIGHT_BLUE}Name: $3${NO_COLOUR}";
#This is the path to the new shortcut
FILEPATH=/usr/local/bin/$3
#Echo the messages
echo "#!/bin/bash" > $FILEPATH
echo "###################################" >> $FILEPATH
echo "# Autogenerated by shortcut-maker #" >> $FILEPATH
echo "###################################" >> $FILEPATH
echo "" >> $FILEPATH
#CD to the directory
echo "cd \"$CDPATH\"" >> $FILEPATH
# $2 is the command to run. Parse any arguments to it.
echo "$2 \$@" >> $FILEPATH
#Make it executable
chmod +x $FILEPATH
#Notify the user
echo -e "${LIGHT_BLUE}Shortcut created!${NO_COLOUR}";
shortcut-maker <directory (can be relative path, as readlink converts it)> <command to execute> <target name>
It creates a shortcut with the "target name" in the /usr/local/bin folder. It makes it executable (do not that I have r+w permissions to this folder).
Basically, since, in Ubuntu, /usr/local/bin is in the path, I'm safe with this. For wine apps, I can do (imagine I want to launch myApp.exe in the current directory):
Code: Select all
shortcut-maker . "wine MyApp.exe" "myapp-launcher"
Code: Select all
shortcut-maker . "WINEDEBUG=-all wine MyApp.exe" "myapp-launcher"
Hope that helped!
Cheers,
Jorl17