Packaging an exe to have one file, similar to on mac with .app - resources

I am trying to create a standalone app with a resources folder that is writable. I would like to include this in the exe, similar as to how it is done on OSX with an .app. Is this possible?
Thanks!

Assuming that you're talking about a modern Windows OS you're probably going to have problems with this even if you could come up with a solution. Most apps gets put under the Program Files directory and by default only Admins have write permissions there so it's generally seen as a bad thing to store anything the app needs to write to next to the executable in Windows.

Related

Synchronize VScode projects between linux and windows with WSL

I'm new to WSL and got the advice to store my VScode projects on Linux for better performance.
The thing is, I would like to keep an automatic sync between these files stored on Linux and a folder stored on Windows since I would like these projects to be stored in my onedrive.
What would be the easiest option to do this?
I'm new to WSL and got the advice to store my VScode projects on Linux for better performance.
The thing is, I would like to keep an automatic sync between these files stored on Linux and a folder stored on Windows since I would like these projects to be stored in my onedrive.
What would be the easiest option to do this?
EDIT: I made a symlink in Windows from the folder on Linux. Will synchronization with onedrive work correctly? (I'd like to be able to use those files again if I change computer). I heard I might get troubles with syncing those files (because of formating, versionning, ...), is it true in this case?

Standard log locations for a cross platform application

I'm developing a cross-platform desktop application for Mac, Linux and Windows. The application will create a plain-text log file to help with debugging, amongst other things. What are people's recommendations for a sensible place to store the log on each of the platforms?
Here is my guess so far, based on web searches:
Mac: ~/Library/Logs/MY-APP-NAME/system.log
Linux: ~/.MY-APP-NAME/logs/system.log
Windows: %APPDATA%\MY-APP-NAME\logs\system.log
For Linux, the XDG Base Directory Specification is followed by some applications. Log files are not specifically called out as such. You can put them either into a subdirectory of the data directory ($XDG_DATA_HOME or $HOME/.local/share), where they will not be deleted automatically, or you could use a subdirectory of the cache directory ($XDG_CACHE or $HOME/.cache). In the latter case, the files could be automatically expired after some time.

Where to put Files for Mono Application in Unix

I am writing a C# application (in Visual Studio on Windows) that will be run as a mono application on Unix (Raspbian aka Debian). I am a Unix noob, and though I have read (well, skimmed) the Linux Foundation Filesystem Hierarchy Standard I am still not completely clear on where I should put the files my application will need. I have:
The compiled C# application (app.exe). I thought I would put this in /usr/bin, except that the application is not run directly (it is invoked by "mono app.exe"), so maybe /usr/libexec is a better location?
Configuration files (there may be more than one) (app.1.conf, app.2.conf, etc.). If they are not user specific, I would think /etc/app (a directory, not a file) would be a good place for these. How about if they are user specific? /home/?
Log file (app.log). Seems that /var/log is the right place for this.
Thanks in advance for your input.
You should look at an already established Mono app for reference. For example let's take MonoDevelop:
The exe file goes to /usr/lib/{appnameinlowercase}/bin/ , but they place a launcher script in /usr/bin, named {appnameinlowercase}, for easy launch from the command line (this script just calls exec mono YourAppName.exe).
In .NET the config files need to be in the same directory as the executable file, so you could place them in /usr/lib/{appnameinlowercase}/bin, then later for convenience, put symlinks to them from /etc/{appnameinlowercase}/.
Correct, /var/log/{appnameinlowercase}/ should be fine.

Live development environment in windows when project is on Linux server

Maybe this question is not so proffesional, but still, maybe someone has got into this issue as well. I am using windows os. And the project i am working on is on Linux servers. I am using Netbeans IDE and WAMP. The problem i ran into is that i cannot make the development environment configured via ALIAS or something similar. I want to DEBUG and run tests but the folder structure is different and it gives me errors, like in windows it is C:/wamp and on the Linux server it is /var/www . How can i make windows machine to get to understand the different file structure ? Maybe there are some guides ? I do not want to switch to Linux. I have everything configured and the only thing i need is like redirect from c:/wamp/myProject to /var/www/myProject
I'm afraid that might not be possible.
You are trying to get one OS to read data from another OS
This is not a problem. However, your issue is that your files are located in directories of different structures, and you are trying to get Windows to read from /var/www directly.
Am I right?

Creating a menu item generically in Linux

For part of a large university project I have built a large java based application. To make "installation" cleaner I am aiming to write a script to copy the jar to a hidden file in the users home directory then add a menu &/Or desktop launcher.
Since I do not know what platform the markers shall be using it seems sensible to make this generic so I was going to build a shell script and a batch file.
The shell script starts off simple, check the directory doesnt already exist, make it and copy the file accross.
Then it comes to making a launcher of some kind. I presume each desktop environment shall do things differently.
After 10 minutes with google it seems everything suggested is autotools but since I have no knowledge of this it seems a bit overkill.
Is there an easy way to achieve what i need?
Thanks
These days, basically all of the desktop environments uses desktop files. For the specification for those files, see the Desktop Entry Specification.
Normally, they're put in /usr/share/applications on the system. Those files are then read and used to construct the menu.
If you have the ability to write to the system /usr/share/applications directory, that's obviously simplest, but if you had that, you would probably be putting the JAR file somewhere other than a hidden directory in the user's home directory.
If not, the path that's supposed to be honored is ~/.local/share/applications. If you drop a desktop file in there, it should show up for the user. (This is somewhat newer; I don't think GNOME 2 supports, it for example. Older desktop environments had various special places for these files.)
Then, the problem basically reduces to figuring out what to write for the Exec line in the desktop file. (See the desktop files on your system in /usr/share/applications for some examples.) If you're lucky, you can get away with just sticking a java command in there, but the details will depend on your application.

Resources