ACCES-Mathieu's Recent Forum Activity

  • The percentage of MacOS users on steam is so low ... in my opinion it's not worth publishing a MacOS version and taking the trouble.

    Who's talking about Steam ? NWJS is not only steam oriented, it concerns anybody wishing to distribute apps on Mac, Linux and Windows.

    And even if the user base is low, this thread helped me a lot in the early days of building desktop apps, that's why I want to contribute in any way possible.

  • Guys, I thought I'd share with you the best signing and notarizing method for MacOS, since it's now the only way to distribute your apps on Mac.

    I found it right here https://github.com/nwjs/nw.js/issues/7117#issuecomment-581738908.

    You have to create a NWsign.sh file that contains this code :

    #!/usr/bin/env node
    
    const APP = "path/to/your/app.app";
    const IDENTITY = "identity of Developer ID cert";
    
    /****************************************************************************/
    
    console.log("### finding things to sign");
    
    const fs = require('fs');
    const child_process = require('child_process');
    
    const items = [];
    
    const frameworksDir = `${APP}/Contents/Frameworks/nwjs Framework.framework`;
    
    let currentVersionDir;
    for (const dir of fs.readdirSync(`${frameworksDir}/Versions`)) {
     if (fs.statSync(`${frameworksDir}/Versions/${dir}`).isDirectory) {
     currentVersionDir = `${frameworksDir}/Versions/${dir}`;
     break;
     }
    }
    if (!currentVersionDir) {
     console.error(`couldn't find "${frameworksDir}/Versions/[version]"`);
     process.exit(1);
    }
    for (const file of fs.readdirSync(`${currentVersionDir}`)) {
     if (file.endsWith('.dylib')) {
     items.push(`${currentVersionDir}/${file}`);
     }
    }
    for (const file of fs.readdirSync(`${currentVersionDir}/Helpers`)) {
     if (/^[a-z0-9_]*$/.test(file) || file.endsWith('.app')) {
     items.push(`${currentVersionDir}/Helpers/${file}`);
     }
    }
    for (const file of fs.readdirSync(`${currentVersionDir}/Libraries`)) {
     if (file.endsWith('.dylib')) {
     items.push(`${currentVersionDir}/Libraries/${file}`);
     }
    }
    for (const file of fs.readdirSync(`${currentVersionDir}/XPCServices`)) {
     if (file.endsWith('.xpc')) {
     items.push(`${currentVersionDir}/XPCServices/${file}`);
     }
    }
    items.push(frameworksDir);
    
    /****************************************************************************/
    
    console.log("");
    console.log("### signing");
    
    function exec(cmd) {
     console.log(cmd);
     const result = child_process.spawnSync(cmd, {shell: true, stdio: 'inherit'});
     if (result.status !== 0) {
     console.log(`Command failed with status ${result.status}`);
     if (result.error) console.log(result.error);
     process.exit(1);
     }
    }
    
    for (const item of items) {
     exec(`codesign --verbose --force --deep --strict --options runtime --timestamp --sign "${IDENTITY}" --entitlements neededToRun.entitlements "${item}"`);
    }
    
    exec(`codesign --verbose --force --deep --strict --options runtime --timestamp --sign "${IDENTITY}" --entitlements neededToRun.entitlements "${APP}"`);
    
    /****************************************************************************/
    
    console.log("");
    console.log("### verifying signature");
    
    exec(`codesign --verify -vvvv "${APP}"`);

    You just have to change the two first const

    1. with your app's path

    2. with the Developer ID Application of your developer.apple.com account. (you have to have this certificate installed in your mac keychain.)

    Then create another file :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
     <dict>
     <key>com.apple.security.automation.apple-events</key>
     <true/>
     <key>com.apple.security.cs.allow-dyld-environment-variables</key>
     <true/>
     <key>com.apple.security.cs.allow-jit</key>
     <true/>
     <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
     <true/>
     <key>com.apple.security.cs.disable-executable-page-protection</key>
     <true/>
     <key>com.apple.security.cs.disable-library-validation</key>
     <true/>
     </dict>
    </plist>

    Place it in the same folder and name it "neededToRun.entitlements"

    Once it's ready, go in the terminal and launch the NWsign.sh command.

    And VOILÀ your app is now signed and ready to notarize.

    If you need further help (on notarization for example), feel free to ask.

    Cheers guys !

  • Hi guys.

    Considering that Construct 2 and the C2 runtime will not be supported next year, we will have no choice but using the C3 runtime. I chose to continue using C2 runtime because the "exported game won't work" alert could be disabled with it, but it still is not the case with the C3 runtime.

    We are aware about the features that we will not be allowed to use when running the file:/// protocol.

    But if these features are not important in our projects, it has to be possible to unblock it, as it was possible on Construct2. https://www.construct.net/en/forum/construct-2/how-do-i-18/remove-warning-quotexported-81632

    What can I do now to run my html5 export when embedded on tablets ?

    Cheers.

    M

  • This might help ?

    Hello.

    Excuse me for the delay, but what is "This" ?

    Thanks !

  • Hi guys. Today I managed to notarize an app made with Construct. I went through Gatekeeper so I guess we have good news here !

  • As far as I'm aware, any MacOS app at all can be notarized. It's like adding a digital signature - it doesn't matter what's in the app or what it's made of, it's just adding a (cryptographic) "verified" stamp.

    Well, notarization is not that simple. That's why I was asking here if anyone has already succeeded in notarizing a Construct app.

    Even codesigning an app created by Construct is everything but easy. It took me a lot of time and researches to finally do it.

  • Can you or someone else here please confirm that it is indeed possible to notarize a Construct app ?

    I'm ok with investigating about it in Apple's doc, but first I'd like to know if anyone here was able to complete a notarization process.

  • Hi NWJS team,

    as you guys probably know, the advantage of using NWJS is that we can easily create apps for both Windows and MacOS which are the two leading OS in the world.

    It is for me the only way to distribute my apps to 95% of the computer users.

    Now I'm really stressed by the way things are going to happen on Mac in a near future :

    MacOS Catalina is here and it is even more restrictive than older versions about the apps.

    Apple told that all Software should be notarized to be readable on MacOS if the app is not distributed through the Mac App Store.

    I have 2 questions about this :

    1. Is it possible to distribute Construct products on the Mac App Store ? If yes, where can I find the guide to do this ?
    2. If not, is it possible to notarize Construct products ? If yes, where can I find the guide to do this ?
  • ACCES-Mathieu If you modify the package.json file after exporting, please also provide the edited version. So far I can't notice anything special with the files.

    The only thing I change in package.json is the last instruction that I add manually :

    --disable-devtools

    Then I follow your instructions to use the tool to secure the assets :

    NW.js Secure Assets.bat and it deletes the package.json

    ACCES-Mathieu The only version I could find is the one released on the 12th August 2019 (v0.40.1), I will base the report on that. I still need more info.

    Any minimal project for reproduction would help. Since part of what you're reporting is a crash, could you please ask a user to zip up the folder called crashpad? I know it's probably something you'd like to avoid but there are no other options, unless you can provide something for reproduction. [%LOCALAPPDATA%\#PROJECT NAME#\User Data\CrashPad]

    My problem is that our customers are not happy with the bug, and DO NOT want to be beta testers of my different tries to find a solution.

    So when I'll have a new customer on the phone, I will definitely access these crash reports, but until then I won't call them back to have access to their computer.

    How outdated are the systems? The problems that come with outdated systems are usually not caused by the OS itself but by the drivers not being up to date. Most of them are included in the Windows Updater nowadays. Issues with the renderer (e.g. outdated graphics driver) should be inside the crashlog as well.

    I'll check this also, but it seemed to me that the last windows update was 2+ years old.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ACCES-Mathieu Please provide the version this started happening and try to narrow it down if you can. How old are systems you both are basing this on? Any minimal project to reproduce and providing your package.json* file would help.

    Here's my package.json :

    { "main": "index.html", "name": "*****", "description": "*****", "version": "1.0.0.0", "window": { "icon": "icons/icon-512.png", "title": "*****", "width": 1024, "height": 768, "position": "center", "resizable": true, "frame": true, "kiosk": false, "show": true }, "user-agent": "Mozilla/5.0 (%osinfo) AppleWebKit/%webkit_ver (KHTML, like Gecko, Chrome, Safari) NWjs/%nwver", "chromium-args": "--enable-node-worker --disable-plugins --disable-internal-flash --disable-popup-blocking --allow-file-access-from-files --ignore-gpu-blacklist" }

    About the version when it occured I'd say it was compiled with the last version of nwjs between july 16th and september 11th (these are the dates of my two releases suffering the bug).

  • Hey, I've been having a strange problem with NW.js that I can't get to the bottom of. Sometimes when I try to preview a project in NW.js, the window will open and then take forever to load. Closing the window or killing it through task manager will then result in the entire computer hanging for a few seconds as if the CPU is maxed out. However, task manager doesn't show any big load on the CPU.

    Hi, I have approximately the same problem here.

    Some customers have reported NWJS blank screens or black screens and crashes on their computers.

    A common point between them is that their Windows are not kept up to date.

    Can you check this ?

    Best regards.

    Mat

  • -> NWjs: Open browser to URL workpath&folder1&folder2

    Hi

    I managed to open a folder on windows with the above command, but it doesn't work on MacOS.

    On MacOS, it'll eventually ask me wich application to use to open a " " extension.

    Any idea on what I could try to do next ?

ACCES-Mathieu's avatar

ACCES-Mathieu

Member since 12 Dec, 2017

Twitter
ACCES-Mathieu has 1 followers

Connect with ACCES-Mathieu