Comments (10)
It looks like there are some icons already added as resources to the QT app. Could we add the icon.ico file and the style.css file to the resources for the QT window and this might allow us to either to
- eliminate an extra image or
- keep all the files internal to the project so we might be able to get a single file when compiling.
Found this article too https://www.learnpyqt.com/tutorials/packaging-pyqt5-pyside2-applications-windows-pyinstaller/
from pydebloatx.
Okay, I might have figured it out!
Seems to be an issue with the --window
command. removing that seems to help. We do see the "command prompt" window before the GUI appears.
Build command:
pyinstaller --noconfirm --onefile --name "PyDebloatX" --icon "pydebloatx/icon.ico" --add-data "pydebloatx/icon.ico;." --add-data "pydebloatx/style.css;." "pydebloatx/app.py"
I did update the resource paths to use the function as described in the posted articles.
def resource_path(relative_path):
if hasattr(sys, 'frozen'):
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath('.'), relative_path)
Then updating the places the icon.ico and style.css files are referenced with an example below.
self.setWindowIcon(QIcon(resource_path('./icon.ico')))
...
with open(resource_path('./style.css'), 'r') as file:
At the first steps we do have a single, portable file. Aesthetically we would want the console window hidden, but the end result is still one file. It is a little slower to open as @Teraskull mentioned as it is extracting files to the %Temp% folder before running. and once we close the application it deletes the the temp directory.
I can create a pull request if you'd like to make these changes.
from pydebloatx.
Hi, thanks for this idea, but isn't the setup installer already making it kind of portable? It just creates a folder on the desktop, which you can put on a flash drive, and it will work the same way.
Regarding custom settings, what exactly are you thinking of? Something like saving a preset of selected apps?
from pydebloatx.
pyinstaller does allow for the --onefile
command but will need to look into adding the dependencies or missing imports more as once compiled the app gave an error stating "Failed to execute script app".
After looking into this there might need to be changes on how the resources get referenced as the onefile method does create a runtime folder and the files might not be extracted to this location. When adding the icon.ico and the style.css to the same directory as the compiled exe the window launches but then closes out.
from pydebloatx.
As you said, --onefile
is not possible with this software, since there is a separate css file. Also, what --onefile
does, is unpack everything in some temp folder on Windows, which I think is not very portable. A lot better would be just to store the folder from the desktop. It also would take more time to launch, because of the unpacking.
from pydebloatx.
I agree with @Teraskull and when the app is compiled to the --onedir
it does place it in its own Directory for that portability and not just one file.
While looking into this there does seem like it could still be possible. When running once compiled there is an __MEIPASS folder and we need to add some additional references to a new location but I've yet to get it working completely yet as one file.
from pydebloatx.
The startup process of one file is really slow. You can add a compressed package (compress the files after the build) as a portable version (*.zip or *.7z).
from pydebloatx.
It would be harder to edit the style.css, as it would need to be generated each time you change something. Also, since the latest PR, there will be language translation files, which won't be possible to pack into the resource file.
from pydebloatx.
With pull request #36 we can mark this issue as complete. Thanks for the idea @designjeevan and @Teraskull for letting me help!
from pydebloatx.
Thank you for your work @cjerrington! Closed until any new issues arise.
from pydebloatx.
Related Issues (17)
- Include build script for executable HOT 3
- Feature request HOT 3
- [BUG] Xbox app does not get uninstalled
- [BUG] "Movies & TV" text is displayed as "Movies && TV" when uninstalling
- [FEATURE] Include Cortana app in removal list since it is a standalone app. HOT 6
- [BUG] Window sizing incorrect when opened over RDP connection HOT 4
- [BUG] Text reads <space> will be available. Should read <space> will be freed. HOT 1
- [BUG] UnicodeDecodeError in line 313 of app.py HOT 8
- app.py not starting HOT 5
- Some discussions about PyDebloatX packaging. HOT 13
- Add functionality to check for updates HOT 2
- Remove For All Users Check Box HOT 6
- Add support to remove Microsoft.BingTranslator HOT 3
- [FEATURE] Add Support To Remove Microsoft Edge & Edge DevTools HOT 4
- Virus alert HOT 2
- [BUG] Building .exe error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydebloatx.