jaruba / wcjs-player

Node Player made for WebChimera.js (libVLC wrapper)
http://webchimera.org/
GNU Lesser General Public License v2.1
178 stars 46 forks source link

Moving deployed Electron app freezes application #21

Closed oleander closed 9 years ago

oleander commented 9 years ago

If I just package an Electron app using electron-packager (with wcjs-playeras a dependency) everything works fine. But if I move my compiled application the app freezes.

I have created a simple application that reproduces this error here: https://github.com/oleander/wcjs-fail

Here's how to use it: Create a binary using ./deploy.sh. I've included the latest bindings for VLC for OSX. If you're using something else you might have to manually change the deploy script. The script will create a runnable binary in the dist/WCJSFail-darwin-x64 folder. Running the binary from here works, but fails if its moved (i.e to the applications folder).

After moving the app and starting it, this is what's shown.

skarmavbild 2015-10-21 kl 01 22 20

Is there a way to solve it?

RSATom commented 9 years ago

@oleander, thanks! I'll look soon.

RSATom commented 9 years ago

@oleander, FYI, I've caught the problem, but didn't find the reason yet.

oleander commented 9 years ago

@RSATom Okay, thanks!

RSATom commented 9 years ago

@oleander, I've found the reason. the problem is in this line: https://github.com/oleander/wcjs-fail/blob/master/deploy.sh#L15 on latest Mac OS X versions, cp command don't copy symbolic links, but copy binaries it points to. I'm talking about this symlinks: https://github.com/oleander/wcjs-fail/tree/master/lib/vlc/lib. The solution is copy links some other way, or recreate symlinks after copy.

oleander commented 9 years ago

cp didn't include the the symlinks. The same apparently goes with electron-packager. It doesn't include symlinks either. I ended up doing this, which worked.

# Same as before
echo "Build package using electron-packager"
./node_modules/electron-packager/cli.js build/ $APP --out=dist/ --version=$VERSION --icon=assets/icon.icns --platform=darwin --arch=x64

# New
LIBFILE=tmp/libvlc.zip
if [ ! -f $LIBFILE ]; then
  echo "Downloading bindings"
  wget -N https://github.com/RSATom/WebChimera.js/releases/download/v.0.1.3/libvlc_2.2.1_mac.zip -O $LIBFILE
else
  echo "Libfile already exists"
fi

echo "Copy VLC bindings"
unzip -q -o tmp/libvlc.zip -d dist/MyApp-darwin-x64/MyApp.app/Contents/Resources/app/node_modules/wcjs-player/node_modules/wcjs-renderer/node_modules/webchimera.js/build/Release

@RSATom Thanks for your help!