MacOS - bundle not executing due to permissions? - macos-mojave

So I've made MACOS_BUNDLE in cmake, & macdeployqt. Everything went great but there is 1 problem. If I run the app on mac where I developed it = all good. If I run it on another MAC, then nothing runs. I have to manually set sudo xmod +x "testApp.app/Contents/MacOS/testApp" So my question is... do I need to ship a mini .sh file that would set the permissions on other pcs too or can I somehow... configure bundle to have it already set?
Thanks

Related

SCNScene initialization from file crashes on macOS Ventura

This is pretty unusual, because I'm unable to replicate the issue on macOS Monterey. I have a SCNScene object that is initialized in viewDidLoad as such:
scene = SCNScene(named: "art.scnassets/preview.scn")!
And as you can see below, the file exists in my project's Resources under the appropriate path:
As previously mentioned, the crash does not occur in builds created under macOS Monterey. Did something change in the resource file path's API?
So far I have tried to initialize using a different way of creating the URL, like so:
scene = try! SCNScene(url: Bundle.main.url(forResource: "art.scnassets/preview", withExtension: "scn")!)
1. Reset the path to Command Line Tools
To fix this issue, install the latest version of Command_Line_Tools for Xcode 14.1 and then execute these two commands in zsh Terminal (password is required):
sudo xcode-select --reset
sudo xcode-select -switch /Library/Developer/CommandLineTools
Restart your Mac.
2. Renaming process
Rename the art.scnassets to artist.scnassets if the above steps still do not help.

WSL can't detect VS code

At first, I tried to fix my problem of npm instruction
so I added
[interop]
appendWindowsPath = false
to /etc/wsl.conf
It works, but another problem happen.
When I type code .
Command 'code' not found, did you mean:
command 'node' from deb nodejs (12.22.9~dfsg-1ubuntu3)
command 'cdde' from deb cdde (0.3.1-1build1)
command 'ode' from deb plotutils (2.6-11)
command 'tcode' from deb emboss (6.6.0+dfsg-11ubuntu1)
command 'cde' from deb cde (0.1+git9-g551e54d-1.2)
Try: sudo apt install <deb name>
The above Error message appear.
I tried the following instruction
export PATH=$PATH:"/mnt/c/Users/%USERNAME%/AppData/Local/Programs/Microsoft VS Code/bin"
It also works properly.
Whenever I restarted WSL, npm instruction still worked well, but code instruction lost its function again.
What should I do to fix the problem?
Thanks in advance!
My main suggestion would be to not use appendWindowsPath = false to fix your NPM problem. That's like using a sledgehammer as a flyswatter. As I said in this answer:
Please do not follow the recommendations (like this answer) to completely remove all Windows paths from WSL, as that will severely limit your ability to run Windows applications in WSL (one of its great features).
You'll also lose access to the ability to run PowerShell scripts and commands in WSL easily. You won't have direct access to wsl.exe itself from inside WSL (which comes in handy).
You can type the full paths to these commands, of course, but most instructions and other answers you find here are going to assume that you've left the Windows path intact.
Instead, figure out where npm is installed in your WSL distribution and then determine why it is further toward the end of the PATH than your Windows directories. Windows paths are added at the end of the Linux PATH for a reason. If something in your startup files is adding to the path, it should put it at the beginning, so it has precedence. E.g.:
export PATH="newdir:$PATH"
Note that I'm not saying that you should change your export statement above since, as mentioned, that Windows path would normally come at the end anyway. It's really not going to matter unless you put another code executable somewhere else in your path.
Whenever I restarted WSL, npm instruction still worked well, but code instruction lost its function again.
If you do want the "quick and dirty" (not recommended) solution, then you can simply add that export command that "makes it work" to your ~/.bashrc. That file is processed each time the Bash shell starts interactively.

Pamac will not load any apps

So I did a fresh install of Arch Linux on my desktop and installed i3wm with it. After updating the repo's following the first reboot I began to add some packages I am familiar with that I can remember off the top of my head. After making sure my wireless internet was working I began to add apps to install to get me all set up and 'pamac-aur' was one of them. After I couldn't remember anymore apps to install I turned to pamac to help me with the rest, only it wouldn't start. I got a "Authentication failed" error. So I did some research and 95% of the posts I read mentioned adding 2 lines to my i3 startup config.
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
I currently have tried both of those lines and each one separately as well since they are almost identical and pamac is still giving me the "Authentication failed" error message. I can 'sudo pacman -Syu' and 'yay -Syu' from the command line but since I am still new with i3 and linux in general, I like referring to an application that shows pictures of different packages and a 'one-stop-shop' to install everything in one go.
So beyond those two lines in my i3 config, I don't know what else to try. Any help is greatly appreciated!
Have you already checked if you have polkit-gnome installed?
This is the package that provides the binary you are trying to execute with the lines you mentioned in you config:
pacman -Syu polkit-gnome
After installing it I would check if it works when starting the agent manually by executing the following in the terminal:
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
Then run pamac and try to install/remove/update a package with it. When a popup appears that wants you to authenticate yourself it was a success.
Then you can add the line to your i3 config.
Also the the second line without the ampersand at the end is enough for your i3 config:
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
For the new line in the config to take effect you would have to, after saving the file, logout and login again.

"Windows Subsystem for Linux has no installed distributions" even though 'Ubuntu' is installed

I recently moved my wsl directory to another drive due to low storage in C: drive. As per the answer provided in this StackOverflow post, I used lxrunoffline tool and moved my Ubuntu distribution to another drive (E:\wsl in my case). As soon as the distribution was moved successfully, I ran wsl to test and it worked like a charm.
Everything went fine until one day I accidentally renamed the E:\wsl folder to something else. Well, as expected, wsl didn't work. Then, I reverted back to the name wsl and expected it to work but to my surprise, it didn't find any installed distribution after that even though it's installed... 😕
E:> wsl
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Is there any way to revert back to the old directory or make wsl point to a manual location?
EDIT: I don't want to reset Ubuntu as I want to retain the installed packages and preferences...
Well, I finally found a solution to this problem. 😊
This is as simple as registering the distribution using lxrunoffline tool using the rg or register command.
E:\LxRunOffline\LxRunOffline-v3.3.3>lxrunoffline rg
[ERROR] the option '-d' is required but missing
Options:
-n arg Name of the distribution
-d arg The directory containing the distribution.
-c arg The config file to use. This argument is optional.
After running the register command, I was able to start wsl as usual. But that would log you in as a "root" user and would thus start in "/root" directory. I ran the following command to start wsl as different user (this is for Ubuntu):
ubuntu config --default-user <user-name>

rvm install fails with or without rvmrc

I'm using rvmrc with the following text:
rvm_path=/local/rvm
(on Ubuntu 11.10) but trying to install gives an obscure error:
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Successfully checked out branch ''
Current branch master is up to date.
Successfully pulled (rebased) from origin
: No such file or directory
Any ideas?
You have no need at all to set $rvm_path. You're using a multi-user install. Please follow the explicit instructions for the Multi-User install at https://rvm.io and remove any existing installations, remove /etc/rvmrc, /etc/profile.d/rvm.sh, and $HOME/.rvmrc. Comment out any RVM sourcing lines in your .bash_profile, and .bashrc and log out of the machine then back in. Then reinstall correctly. Setting the rvm_path has never been a requirement of the installer UNLESS you already have a Multi-User working installation in place, and you want to attempt to use a per-user install with it. THEN you would preset the $rvm_path to $HOME/.rvm in your own $HOME/.rvmrc, log out then back in and then attempt the install again. BUT, that is not a supported installation type. Which is why 99.999% of users will not need to set rvm_path at all.
The real problem was that the git configuration for auto-converting line endings was not set correctly which prevented any installation from working. It had nothing to do with using rvmrc settings.
The fix for this is simple (and comes straight from the github help page):
$ git config --global core.autocrlf input
Line endings are important in linux and by forgetting that setting, everything the rvm-install script was pulling from github had \r\n endings. I made that change so long ago on my work machine, I didn't even remember it -- but it was not set on my home system.
I'll leave it up in case someone else has the same problem.