1
1
I have a directory (which is later archived) in which a shortcut to an executable file (.exe), which itself is a few directories deeper. The first problem encountered is ".lnk" shortcuts require exact path. E.g. "D:/someFolder/parentOfShortcut/files/dir/dir/dir/software.exe commandForTheExe" and if the directory parentOfShortcut is moved to the root (for example), the shortcut will be still looking for the app in "D:/someFolder/parentOf...". I thought of using a ".bat" file, however, that's a Windows-only solution, while the app itself is compatible also with both Linux and MacOS. The second problem of the ".bat" is that users never trust that type of files so does any antivirus software.
It is a quandary that the location of parentOfShortcut can be anywhere since users download that folder (as a .zip archive) and are free to save it in any given directory on their machine.
For reference, here's the exact file structure
(unknown path)/MySoftware(.zip)
+- Shortcut.lnk
|- files
|- node_modules
|- dist
+- theApp.exe (with command "boot.main")
Edit:
The .exe can't be moved, for it depends on .dll files in the same, in the upper and in some lower-level directories.
How is the app itself cross-platform? Mac apps tend to be bundles with the executable at a given level, myApp.app/Contents/MacOs/myApp so should always 'know where they are'. – Tetsujin – 2018-09-05T07:04:32.510
@Tetsujin The path is not really unknown; it depends on where the user installs the archive. – Zefir Zdravkov – 2018-09-05T07:10:53.607
apps go in /Applications usually or for single user ~/Applications. Finder will know where it is anyway. They are normally delivered as ,dmg files with a handy drag & drop to Apps, unless they need an installer & elevated permissions. – Tetsujin – 2018-09-05T07:13:09.490
@Tetsujin I am not personally a macOS user, but the application (Electron) claims to be executable and fully functioning under that platform. – Zefir Zdravkov – 2018-09-05T07:15:30.673
You could use a ".bat" file for Windows and other scripts for Linux & Mac. But the usual solution is to have a platform-dependent installation script that will create the link. – harrymc – 2018-09-05T07:18:54.883
looks like some javascript thing. way outside my area of expertise & something you should be asking about in stack overflow. Anyway... there's no such thing as a cross-platform 'shortcut' - Mac can't parse .lnk files & Win doesn't know what to do with an alias – Tetsujin – 2018-09-05T07:20:31.827
@harrymc The platform-dependent installation will have to be in this case just because of the shortcut since the
.exe
itself is cross-platform executable. – Zefir Zdravkov – 2018-09-05T07:20:53.377@PimpJuiceIT the
exe
is by a verified publisher: GitHub – Zefir Zdravkov – 2018-09-08T04:44:05.053@PimpJuiceIT the
exe
is by GitHub (and Google apart) and the users download it from my website, not github.com or google.com because the.zip
includes files and additional software I produce. If you downloaded Chrome from un unknown publisher, would you execute some.bat
from the root? I wouldn't, but I'd certainly run a shortcut to the app itself, because what harm could it do? – Zefir Zdravkov – 2018-09-13T10:07:44.743No worries, do what you wish and good luck!! As an FYI, there are many zip packages that include batch scripts that run optionally as-needed post extraction for various reasons so what I suggested is what I've seen included with many packages as you describe. I'm more of an admin than a package developer so only suggested what I consider "normal and typical" from my years working on many projects as such at the level of systems and packages I've had to deal with for various companies and industries. You can open a bat file and see it's logic/contents whereas you cannot with an exe like that. – Pimp Juice IT – 2018-09-13T12:24:19.883