Origin Forum

This is a community forum and not official technical support. — If you need official support: Contact Us

The following comments are owned by whoever posted them. We are not responsible for them in any way.

Back to Threads Reply to Thread

The C Program in the Tips.

So, I was looking at this and I saw that your c program just spams the chmod command in a loop. Does the origin update process somehow change those permissions multiple times so that it needs to be spammed or do you think just a run pre and / or post install would work?

Yes, Origin is stupid and somehow manages to remove write permissions on its directory while it is updating.

Spamming chmod in a loop is a pretty dumb way to go about working around, it, though. Especially by calling out to a system executable from a C program instead of calling the kernel. Even more especially calling chmod 777. That's just asinine bad code no real programmer would ever write. Simple Bash "one-liner" will do it with no need for silliness:

ORIGIN=~/whereEverYourDriveCMayBeInWineOrCXOrProton/Program\ Files\ \(x86\)/Origin; while true; do inotifywait $ORIGIN; chmod u+w $ORIGIN; done

Change the directory at the beginning as needed. Actually use the hooks that the kernel provides (inotify) and only chmod when really needed. Just hit CTRL+C after the update is done to kill it.

1

Ok thanks, that helps as it just seemed odd to compile a c program for it. Seemed like bash could handle it. I'm going to do some more research on inotify because only some of my systems are linux and some are mac, but I think I can figure out a duplicate solution with a bash one liner with fswatch on the mac systems.

The bash script above will not work for Mac users as inotifywait is a Linux-specific command. I wrote a modified version that uses fswatch instead, which should be available to both Mac and Linux users. Mac users will need to install fswatch using brew or some other method.
$ brew install fswatch

I use the following script:


#!/bin/bash
ORIGIN=$PWD/Program\ Files\ \(x86\)/Origin

fswatch -o "${ORIGIN}" | while read; do
  chmod u+x "${ORIGIN}";
  echo 'Permissions updated.';
done

Run this script from the "drive_c" folder of the Bottle you have Origin installed in. (The script does not need to be located there.) Personally, I prefer a file script to a "one-liner" in case I need to make changes later (and an "echo" statement to tell me that it's working), but you should be able to adapt this to a single command line.

Hi folks,

Our testing shows that the script is no longer necessary to install Origin: it works just fine without it (on CrossOver 21.1, and potentially other versions).

Best,
Meredith

CrossOver Forums: the place to discuss running Windows applications on Mac and Linux

CodeWeavers or its third-party tools process personal data (e.g. browsing data or IP addresses) and use cookies or other identifiers, which are necessary for its functioning and required to achieve the purposes illustrated in our Privacy Policy. You accept the use of cookies or other identifiers by clicking the Acknowledge button.
Please Wait...
eyJjb3VudHJ5IjoiVVMiLCJsYW5nIjoiZW4iLCJjYXJ0IjowLCJ0enMiOi02LCJjZG4iOiJodHRwczpcL1wvbWVkaWEuY29kZXdlYXZlcnMuY29tXC9wdWJcL2Nyb3Nzb3Zlclwvd2Vic2l0ZSIsImNkbnRzIjoxNzMxNDM1MjAzLCJjc3JmX3Rva2VuIjoicGRBcGR4NWdlYkpVSmNVdiIsImdkcHIiOjB9