Standalone HTML Application - hta

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

Related

Build directory for Qt Creator IDE

I am trying to populate a QTableview with some data. When developing under Qt Creator, data is read from build directory. Running the program each time, the QTableview keeps getting repopulated with previous data.
If I manually change the build directory each time before run, doesn't happen. But how do I solve the problem without manually changing the build directory every time I want a fresh run?
In your project directory there is a file name ProjectName.pro.user.
This file creating when you configure your project. it's XML file.
you can find this line on *.user files:
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/probook/Documents/Qt/testProject/Build/Windows/Debug</value>
This line define build directory address for debug. there is a same line for Release and Profile in that file.
You can also use Qt creator to define(customize) relative directory build:
goto Qt creator, Tools, Options..., Build & Run, General, Default build directory.
More info:
Qt Creator stores user-specific project settings in a .pro.user file. You can share these settings between several projects as a .pro.shared file. It has the same XML structure as a .pro.user file, but only contains the settings to share.
Based on comment, issue seems to be data which gets saved to build directory. And solution would be to remove it before running the application.
You can add Custom Process Step, either under Projects - Build Settings -
Build Steps, or under Projects - Run Settings - Deployment, and just delete the desired data files. Exact command depends on operating system.
An alternative might be to add a command line switch, something like --development-erase-saved-data, to the application itself, and erase the files (or just not read them, or whatever). Then add that command line switch to Projects - Run Settings - Run Steps - Command Line Arguments for desired build configurations.
Adding support for this in the application itself is easier to maintain, and is almost automatically cross-platform. However, it might be a feature you don't want in the application, though in that case you might only enable it for Debug builds (with #ifdef).
As a side note, saving data to executable directory is not a good idea these days. You might want to save it for example to location returned by
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
(See here for more info.)

Pentaho Kettle - Conversion of a job to jar file

Is it possible to convert a pentaho job to jar file? if it so please tel me how? i tried to convert a job to jar but failed due to the class problems.
In JAR, we aggregate many Java class files. But in PDI Jobs, the files are in XML files. Pentaho uses its DI Engine to read these XML files. Hence we cannot create JAR files out of an XML file.
You can run an ETL job from java code, using kettle's api. You can't convert a job into a jar.
If you launch a job or a transformation in batch mode, you have to use the scripts kitchen or pan (with sh or bat extension dopending on the OS). Actually those scripts run a java program inside, using the parameters that you pass to it. One of the parameters has to be the path of the file .Kjb (extension of a job), which is a regular xml file. So the xml files are necessary, but you can launch directly the java command (the one inside of the sh/bat script) passing the required paramenters to it. To see which parameters it needs you will have to do a reverse engineering work on the kitchen/pan script, which are really simple and short inside.

Being able to run java application on different computers without JDK

How can I send my java application to a friend without having to send the entire project and being dependent on him having JDK? I'm aware of the .jar-file's existence, but I don't know how to proceed. I would like to be able to just send him the .jar-file or an executable file.
Any ideas?
Compile it to native code using a compiler such as http://en.wikipedia.org/wiki/GNU_Compiler_for_Java
Also, he doesn't need the JDK, just the JRE.
Did what #Barranka said regarding the dist folder, didn't know that worked until I read the readme file as #Barranka suggested.
So to quote what #Barranka said:
If you work with NetBeans, when you "build" your project, a dist
folder is generated, and your "packed" app is stored there. You can
send the contents of this folder. Read the "readme" file in that
folder. – Barranka
You can send the JAR file alone provided your program does not depend on other libraries. Assuming that there is a main() method and Main Class is configured in the JAR's manifest, the person can run it by Double Clicking (on windows) or use the command line
java -jar <jar_file_name>.jar
You cannot execute a Java application without a Java Virtual Machine, so you need one.
Your friend has to download a JRE/JDK, or you can provide it with your application directly as it (the JRE and your project in an archive) or provide it as a native compile code using GCJ or Excelsior Jet which will compile your application and a JRE.
As you can see the is no solution for your question, but there is one for your problem : ask your friend to download a JRE.

create setup for an existent exe file

I want to create a setup for an existent .exe file. This file needs some .ocx and .dll files to run correctly. So this mentioned setup should paste these all files in a specified path and then run the .exe file.
I have tried with installshield 2010 basic and InstallScript projects but i could not create some of dialogs in the format that i wanted.
Is there any way to create this setup? Or any one may help me to work with installshield?
You might find working with another setup program easier, try the NSIS (Nullsoft Scriptable Install System). It has a RegDLL function:
RegDLL "$WINDIR\OCX\vbalGrid6.ocx"
if you need that also.

Qt including resource directory structure inside executable

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.

Resources