I have searched but can find no way to read PYZ files. I know they are a type of zip file, but I can not read them by way of a zip program.
This is in reference to another question where I need access to the _init__ file inside a directory structure that is created by pyinstaller when attempting to build an exe. During this process, a out00-PYZ.pyz file is created, and the error references a file inside the PYZ.
The thread here describes how to decompile from an EXE to obtain PYC files, but doesn't work with PYZ files.
Surely there is someway to crack open this commonly used pythonic file?
Many thanks in advance.
If you had used Pyinstaller you can go to the location of directory which contains .pyz then go SHIFT and right click on directory, go to open command window here, then:
pyi-archive_viewer out00-PYZ.pyz
Related
I want to translate a program; but its language files (.qm) are in a .rcc file.
The program is not mine, so I haven't got any .qrc file.
Before asking this question, I have searched this site about this issue; but I don't attain anything.
Is there any way to extract/decompile it?
You can take my tool RccExtended - it based on the official Qt resource compiler with additional function to decompile binary resources.
Usage example:
cd \Path\To\MyQtResources\
rcc --reverse
Decompiler will unpack all .rcc files in the current directory, generate .qrc files and make.bat file to compile resources back to the binary format.
There isn't a supported way to decompile it as far as I'm aware, but it's a binary file format that can be read and handled. There's a nodejs example of how to read the file and extract PNGs on github: https://github.com/gcochard/png-extractor. It may be possible to extend that method out for the .qm files.
However there's other issues with attempting to add more translations to a Qt application without having the code, depending on the language you're attempting to add, how the developer has exposed the other languages etc.
I'm sorry if this question has been already asked but I did not found it on StackOverflow.
Here is my problem, I have a JAVA project, and I create an executable .jar file with it and I want to know if it is possible to create a .bat file or something to automatically create a shortcut on the user's Desktop and how to do that.
I also want to know if it is possible to automatically place an Icon on my executable .jar and how to do it.
I've already searched the net to find solutions to my problem and people says things like it depends of the OS and create a .exe to do it, but I d'ont want to create a .exe file with my .jar executable file.
And I also did not totally understand what they were talking about...
You can create a StartJar.bat file in the Desktop itself.
Then edit that .bat file and add the following:
#echo OFF
cd <path to the executable jar>
java -jar yourJar.jar
In my Qt application we can open a help file (chm) by doing the following:
QDesktopServices::openUrl(QUrl::fromLocalFile(_PathToTheCHMFile));
This seems to be the suggested way of doing things. And it has worked up until now.
However, the documentation team has now changed how the chm files work. Now we are referencing a "master" file which only contains references to other chm files. The directory structure of the chm files is as follows:
master.chm
SUBDIR/
-> child1.chm
-> child2.chm
...
If open the master.chm file with hh.exe (the default tool in windows), everything looks perfect. However, from my Qt application, the help file opens, but there are no sub topics, just the root node.
I assume this is a search path issue, and it can't resolve the relative paths. There doesn't seem to be any way to configure the openURL call to run from a certain directory, or anything like that.
Thanks in advance
If you need to be able to access those elements properly, then you may need to change your applications current directory on the fly.
http://qt-project.org/doc/qt-4.8/qdir.html#details
http://qt-project.org/doc/qt-4.8/qdir.html#setCurrent
If that doesn't work, you may want to look into using QProcess::startDetached
http://qt-project.org/doc/qt-4.8/qprocess.html#startDetached
and specifying the working directory to be exactly where your master.chm is located.
You may want to specify some command-line arguments, too.
http://www.help-info.de/en/Help_Info_HTMLHelp/hh_command.htm
Hope that helps.
Is there an application that can create a standalone HTA, which means no need 'mshta.exe' to run and not leaving any temporary files? i've try 'htaedit' but it need 'mshta.exe' and leave temporary files.
I don't think that hta can be run standalone. it is more of an interpreted language which is interpreted by mshta.exe. sort of like how java byte code is interpreted by the jvm
You could create a self extraction drive using iexpress.exe which :
zips a copy of mshta.exe and your hta file
unzips them to a temporary folder at runtime
and runs a specified command. eg : mshta <the hta filename>.hta
iexpress is commonly used to created quick and dirty installers.
I came to know of this process while finding a way to convert .bat / .cmd files to .exe
I'm using QWebView to run a web app. There are 650+ files. Placing the web app's directory in the source directory does not result in the executable bundling the directory.
How do I include the entire web app directory so that the executable will be able to render the files.
Note: I have currently added index.html as a resource, and can access it with qrc:// - But since I cannot add the entire directory structure to a qrc (can I?), the executable does not include the other files.
You need to put an XML node into the .qrc file for each file you want to use using the Qt resource system.
This can be done using a simple pre-build script. Take a look at qrcgen. Quoting the blog post behind this link:
The script I created, qrcgen, takes a directory and a prefix, recursively scans the directory and generates a .qrc file with the same name as the directory scanned. It has solved my problem, and I hope it can help others. It is also available via PyPI, just "easy_install qrcgen".
In order to update the .qrc file whenever your directory contens change, you need to include this step into your build process:
For C++/Qt projects, you can add this step in the build configuration in QtCreator or add in your qmake file a system(...) statement. Note that such commands aren't portable in general. (If it's not portable, you can put some operating system conditions around multiple commands.)
For PyQt/PySide projects, I don't know how to do this, but I'm sure you find a solution for this too.