Coder Social home page Coder Social logo

Comments (18)

a7ul avatar a7ul commented on July 17, 2024 2

Looks really neat!

from packer.

m4heshd avatar m4heshd commented on July 17, 2024 1

Thank you. So I'll keep in touch with NodeGUI and try to do some contributions myself in the future. This project definitely is going places. ⭐⭐⭐⭐⭐

from packer.

a7ul avatar a7ul commented on July 17, 2024 1

You can give this a try: https://stackoverflow.com/questions/2435816/how-do-i-poke-the-flag-in-a-win32-pe-that-controls-console-window-display.
I havent tried it yet though.

from packer.

blncd avatar blncd commented on July 17, 2024 1

Thanks, it works with patched PE header. (used the python script)

Alternative for Microsoft VisualStudio users: editbin.exe /subsystem:windows qode.exe

from packer.

bolte-io avatar bolte-io commented on July 17, 2024 1

The thing is if you pack all the Qt dll's into a single executable that doesnt allow modification of qt libs then you are not compliant with Qt's LGPL license. This would mean you would need to buy a commericial license. That is the reason Nodegui packer doesnt pack them into a single executable file.

But maybe we could use an installer framework in windows do build out a single msi file (although this needs work)

Can this not be specified via cmd line argument in the built passed into qode.exe?
This is because during development its much easier if we dont mention the start file at all and qode.exe behaves just like the node.exe (this allows debugging, testing, etc)

Oh sorry, that's not what I meant.
I mean the dist folder and the config file mainly packed into the qode.exe, so its just qode.exe (or whatever you name it to be) along with the DLLs in a folder. This would be cleaner imo.

from packer.

a7ul avatar a7ul commented on July 17, 2024

After you run the init command.
using npx nodegui-packer --init MyApp

you get a standard native os package. So for mac you will have a info.plist ,etc This you can edit and make it suite your needs.

Then whenever you need to build you would always run the second command
npx nodegui-packer --pack

this should pack the dist files and required libraries and create an image.

from packer.

m4heshd avatar m4heshd commented on July 17, 2024

Thanks for the response @master-atul.
I've tried this and got a successful result but how to have a custom icon and a custom name for the executable without using any third party script as mentioned in the documentation? The output is always qode.exe with the NodeGUI icon. (Trying only on Windows for the moment)

I only get the following files inside deploy directory after running init

image

from packer.

a7ul avatar a7ul commented on July 17, 2024

qode.exe can be renamed to anything you need once the build happens.
and you might need to use https://www.npmjs.com/package/rcedit
to add a custom icon to it.
We can later on add this functionality to packer itself. But it suffers from this limitation for windows. :/

from packer.

m4heshd avatar m4heshd commented on July 17, 2024

That's exactly what i currently do on my project at m4heshd/whatsapp-desktop-dark/build.js so i guess i have to stick with my current setup right? Either way, your responses are much appreciated.

rcedit is actually not functional at the moment.

from packer.

blncd avatar blncd commented on July 17, 2024

I currently do it as follows:

Binaries:
The qode.exe is not copied again with every "npx nodegui-packer --pack" command, so you have to replace the icon for the binary only once in a while. I use http://angusj.com/resourcehacker/ for this.

Application windows:
Icons for newly created windows can be set like this:

const myWindow = new QMainWindow ();
myWindow.setWindowTitle ('myWindow');
const icon = new QIcon ('dist/assets/myIcon.png');
myWindow.setWindowIcon (settingsIcon);

Repeat this step for all windows that are created.

The only thing that currently bothers me is the console window that appears briefly when a Windows application starts, everything else works very well.

from packer.

m4heshd avatar m4heshd commented on July 17, 2024

@blncd yup. That's exactly my current setup. Unfortunately the license for reshacker prohibits third party distribution so i had to use a postinstall script/module for the reshacker installation since i can't include in the repo.

from packer.

a7ul avatar a7ul commented on July 17, 2024

I currently do it as follows:

Binaries:
The qode.exe is not copied again with every "npx nodegui-packer --pack" command, so you have to replace the icon for the binary only once in a while. I use http://angusj.com/resourcehacker/ for this.

Application windows:
Icons for newly created windows can be set like this:

const myWindow = new QMainWindow ();
myWindow.setWindowTitle ('myWindow');
const icon = new QIcon ('dist/assets/myIcon.png');
myWindow.setWindowIcon (settingsIcon);

Repeat this step for all windows that are created.

The only thing that currently bothers me is the console window that appears briefly when a Windows application starts, everything else works very well.

The console window that appears briefly can be fixed using resource hacker i think. You ll need to just set a flag on the executable that converts it from a console app to a gui app. I dont remember exactly. But I can get back to you on this.

from packer.

a7ul avatar a7ul commented on July 17, 2024

Amazing!! 🚀🤘

from packer.

bolte-io avatar bolte-io commented on July 17, 2024

qode.exe can be renamed to anything you need once the build happens.
and you might need to use https://www.npmjs.com/package/rcedit
to add a custom icon to it.
We can later on add this functionality to packer itself. But it suffers from this limitation for windows. :/

I have just built an exe and the DLLs on windows, and it will not open the exe if qode.exe is renamed. It will also not launch if qode.json is removed or renamed. Is this intended behaviour?

from packer.

a7ul avatar a7ul commented on July 17, 2024

Yes qode.json needs to be present since it tells qode.exe which file to launch.
renaming qode.exe shouldnt ideally cause issues. But if it does, for now you could create a shortcut of it and rename that as your starting point of the app.

I ll check why renaming qode.exe causes an issue.

from packer.

a7ul avatar a7ul commented on July 17, 2024

Thanks, it works with patched PE header. (used the python script)

Alternative for Microsoft VisualStudio users: editbin.exe /subsystem:windows qode.exe

Latest version of packer should do this automatically :)

from packer.

bolte-io avatar bolte-io commented on July 17, 2024

Yes qode.json needs to be present since it tells qode.exe which file to launch.
renaming qode.exe shouldnt ideally cause issues. But if it does, for now you could create a shortcut of it and rename that as your starting point of the app.

I ll check why renaming qode.exe causes an issue.

Can this not be specified via cmd line argument in the built passed into qode.exe? So that the name then does not matter. The inability to rename isn't massively an issue, as I can create a simple wrapper to launch qode.exe.

Alternatively, is there any further way to pack the files into one exe? With or without the DLLs needing to be in the same folder.

from packer.

a7ul avatar a7ul commented on July 17, 2024

The thing is if you pack all the Qt dll's into a single executable that doesnt allow modification of qt libs then you are not compliant with Qt's LGPL license. This would mean you would need to buy a commericial license. That is the reason Nodegui packer doesnt pack them into a single executable file.

But maybe we could use an installer framework in windows do build out a single msi file (although this needs work)

Can this not be specified via cmd line argument in the built passed into qode.exe?
This is because during development its much easier if we dont mention the start file at all and qode.exe behaves just like the node.exe (this allows debugging, testing, etc)

from packer.

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.