Giter Site home page Giter Site logo

Comments (11)

mmaietta avatar mmaietta commented on May 24, 2024 1

Excellent debugging, thank you! I'll take a look when I have a chance, potentially this week if I can find time after work.

from electron-builder.

mmaietta avatar mmaietta commented on May 24, 2024

Hmmm the post install script never changed, the only change was adding BundlePostInstallScriptPath and BundlePreInstallScriptPath keys and script names to the Info.plist. I'm not familiar with pkg and was only provided guidance on the expected behavior, it shouldn't have changed the $2 arg though AFAICT. What is the impact of the $2 argument not working as it previously was?

If a postinstall script was open -a $2 to autolauch the app, wouldn't /Applications/electron-builder-test.app be the correct arg?

from electron-builder.

MaximKalinin avatar MaximKalinin commented on May 24, 2024

What is the impact of the $2 argument not working as it previously was?

I am trying to access files that are placed inside the installed app folder. For that I access "${2}/electron-builder-test.app/resources/". It used to evaluate to "/Applications/electron-builder-test.app/resources/", but now it evaluates to "/Applications/electron-builder-test.app/electron-builder-test.app/resources/" which does not exist.

If a postinstall script was open -a $2 to autolauch the app, wouldn't /Applications/electron-builder-test.app be the correct arg?

The thing is, it used to be open -a "${2}/electron-builder-test.app".

from electron-builder.

mmaietta avatar mmaietta commented on May 24, 2024

I still think it's expected behavior from my quick research
https://stackoverflow.com/a/11636246/3498974

$0 - Script path
$1 - Package path
$2 - Target location
$3 - Target volume`

My guess is that adding BundlePostInstallScriptPath added the proper configuration for the postinstall script to properly run

from electron-builder.

MaximKalinin avatar MaximKalinin commented on May 24, 2024

I still think it's expected behavior from my quick research

Does it mean that all the previous versions were working incorrectly, passing /Applications as a second argument?

from electron-builder.

mmaietta avatar mmaietta commented on May 24, 2024

That's my current hypothesis. If you look through the PR code diff, there's nothing setting the path or changing the executable script itself. Rather, it's simply scanning the install scripts directory, identifying any that are preinstall/postinstall and adding that file entry into the Info.plist. It doesn't modify the pkg scripts' arguments itself.

from electron-builder.

MaximKalinin avatar MaximKalinin commented on May 24, 2024

What is the manual step for generating .pkg file? If I try pkgbuild --root --scripts --component-plist I will get the expected /Applications as a second argument.

If you look through the PR code diff, there's nothing setting the path or changing the executable script itself.

The bug is not necessarily introduced by this PR, it could just be revealed now.

from electron-builder.

MaximKalinin avatar MaximKalinin commented on May 24, 2024

Ok, I think I found the real issue. It actually runs the postinstall script twice. Once for the application and once for the component specified in plist file. This seems like a bug to me.

from electron-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.