3

So... New to this Ubuntu thing. On 16.04.

I will try to explain this as best I can with what computer knowledge I have. I have searched for a while and can't find an answer that works.

I purchased a computer with intentions of upgrading my business computer. Using Ubuntu because the reseller had wiped the OS. I am running DOSbox for my POS system and Wine for the .Exe that the POS system uses to print reports from Dos. I need to be able to have those programs executable from desktop icons because it needs to be as EASY as possible for employees.

My problem is this: All files for this program are written and read from my POS folder. When creating a link icon for my printer.exe file, the "LINK TO PRINTER.EXE" file is not reading the data from the POS folder. Instead it wants me to configure printers like it was started for the first time. If those printers are configured from the desktop "link", DOSbox does not recognize them because, I can only assume, the link is more like a copy instead of a shortcut to the file inside of the folder.

Printer.exe, when clicked, opens automatically with Wine, so I figured I could lock the icon to the launch bar. After closing the application, The icon changes to a question box and will not open printer.exe.

DOSbox is dedicated to my POS, so I used the autoexec lines in dosbox.conf to start the POS from the DOSbox icon automatically. I figured I could add "printer" before "pos" in the autoexec lines to make the printer automatically open right before the pos. DOSbox says no and tells me the printer.exe file cannot run because it is a Win32 program. Well, printer.exe isn't a dos program. What was I thinking?? Why am i typing this???

Is there some way to create a link to printer.exe and edit the file path to be directed to the printer.exe file in the POS folder? I do not want to give employees a reason to open the POS folder in fear something may be deleted!

Thanks!

5
  • I'm not sure I fully understood, so to sum up shortly: if you run that .exe file from the directory where it is, everything fine; otherwise, being ran by the link, it's not, right? Well, no surprise: Windows apps often reading configs from a directory where it is ran, i.e. when you run it from another directory, it doesn't see configs. There're different ways to workaround it, the simplest one is to create a script which would enter the directory with the .exe, then run the app. Another one is to create .desktop file with Path= variable (which would do essentially the same). – Hi-Angel Aug 4 '16 at 5:31
  • But you're solving the wrong problem, because if the POS dir is accessible with link, it is accessible to a user as well, even if they doesn't know how to get there. Security by obscurity never works. Instead you ought to create a separate user for employees, and leave all rights into the POS for owner/group; and only read/execute (no write) rights into the POS dir for all users. Ah, and make sure the new user is not in the group with write access. – Hi-Angel Aug 4 '16 at 5:40
  • I am not worried about them having access... It's more so i don't want them to have to go in there if they don't have to and having something accidentally changed. Although it IS a good idea! I would have to implement it later. – SegaSaturn Aug 4 '16 at 22:35
  • 1
    Oh. If you press enter, it posts a comment. I took your suggestion and looked up how to create a .desktop icon. The Exec= /home/user/pos/printer.exe was not working until I changed it to Exec= wine /home/user/pos/printer.exe Although this works, it does not actually work with the printer.ini file inside of the POS folder. I was wondering why it was working but not reading the printer.ini. Like you said, I added a line with Path= /home/user/pos AND NOW EVERYTHING WORKS!!! You're an angel, Angel! – SegaSaturn Aug 4 '16 at 22:58
  • 1
    @Hi-Angel Can you write an answer since OP said your solution works? – edwinksl Aug 4 '16 at 23:23
0

Unlike GNU/Linux apps, Windows apps rarely separate its configs from binaries (and no, putting configs into a subdir around binaries, and calling it a separation, is like tightly shove things into a cupboard, lock it up with mop, and say "the room is cleaned"). And they assume that they being ran from the directory where they installed, in part because .lnk files on Windows automagically set base directory there (the link is just an example, I didn't mean to recommend a .net based language).

There're a few solutions I see off the top of my head:

  • Create a script which would cd into the directory with the app, then would run it.
  • Search for a command line argument, of the particular app you want to run, allowing to set a directory with configs. Then write a script which would run the app with that argument.
  • Create a .desktop file with Path= variable being set, which sets the working directory to run the app in. In your case of giving the access to employees, it's probably the most appropriate of the listed methods, as it allows to set an icon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.