What I trying to do is to run hg commands using firefox extension without showing command prompt window all the time.
I initiate process with hg.exe file and then execute hg commands by passing arguments in to it.
process.init("hg.exe");
args["update"];
process.run(true,args,args.lenght);
But I am confused how I am going to use hstart.exe on top of it
Any suggestions ?
Just pass hg commands as arguments in hstart.exe...that will do the trick !!!
Related
I am building an installer for our product which works well. I've managed to build custom actions to install our services including a MySQL server.
The problem I have is executing a sql file to build the schema structures.
I have a custom action which uses mysql.exe and the command line arguments:
--port=### --user=### --password=### < "[INSTALLDIR]db\EmptyStruct.sql"
It tries to execute this ok but the cmd window which pops up, during the install, just runs through the mysql.exe command line options, which says to me that the command line it gets passed is not correct. However if I run the command manually after the install, it works perfectly.
Does anyone has any ideas please.
I'm making a few assumptions here:
You have a Windows Installer exe custom action that specifies mysql.exe and a command line as you showed
You are expecting the contents of [INSTALLDIR]db\EmptyStruct.sql to be redirected to mysql.exe's standard input
This will not happen. Behind the scenes, Windows Installer's exe custom action support uses the CreateProcess API and this API will interpret command lines literally. However the redirect < needs special handling to actually perform redirection.
To get that behavior, you must use a layer of indirection. For example, you could run cmd.exe as the exe, and give it a command line that will make it interpret and run the command line mysql.exe --port= ... < "[INSTALLDIR]...". However, if you didn't already have a command prompt showing, this would cause one to show up. If you want to avoid that, you could write a custom wrapper that performs the redirection for you, either as a C++ DLL or, say, InstallScript action.
Alternately, if there is a parameter that tells mysql.exe to run a script from a file, you could pass that instead of using redirection. I wasn't able to find evidence of such a parameter in a quick web search.
Thanks for your comments Michael and I used cmd.exe /k AddStruct.bat to accomplish the task!
I have added my webpage contents to /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/dependencies/jbossews/webapps/ directory and I can see my webpage.
I have not used git repository.
I tried adding one shell script under /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/repo/.openshift/cron/hourly directly. I dont see the script running.
I feel it has to be pushed to some service. Can this be done without git at all?
Adding example:
I have not created a git repository.
I have a index.html with just some header and body placed under /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/dependencies/jbossews/webapps/test/.
Now I can access the website like www.test-rhtest.rhcloud.com/test/index.html
Now I have a shell script say test.sh. It is as below.
#!/bin/bash
echo date >> $HOME/app-deployments/temp.txt
I execute the script test.sh and it creates the file there $HOME/app-deployments/temp.txt.
Now I have placed the file under /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/repo/.openshift/cron/hourly. I waited for hours to see execution, but no luck.
How should I enable this cron now?
The file SHOULD run, but you have to make sure that you made it executable (chmod +x) on the server. Also, make sure you can run it manually without getting any errors. Also, it seems you should put it into your ~/app-root/repo/... directory, instead of the runtime one.
Is there a cygwin equivalent of posh-hg ?
I checked this post and there seem to be a lot of option available for git but sadly I couldn't find any for Mercurial.
What I am looking for is the branch and modification information that Posh-gh puts at the prompt, tab completion would be a nice additional touch but its not my main focus here.
hg prompt should work just fine in cygwin, as should the bash completion script that ships with Mercurial.
I am trying to automate hg commit and hg push commands , for that I need to call those commands from firefox extension (which I am working on). Is there a way to do it without using batch files ?
Yes, you can just call hg directly like any other process.
See here how to make a command line call from within a firefox extension.
Of course for the call "initWithPath" you must specify the hg command line binary, that is also executed when you type "hg" in a Terminal window. And this command line utility will have different locations on different platforms. So if you expect the extension to work crossplatform, you should offer a preferences panel, where the users can enter the path to their local hg binary and by default you could also put there the standard path where most users on that platform would have installed hg to.
I am using firefox extension to run hg commands on my repository. But when ever I execute any hg commands it shows command prompt window for a split second and closes it.
Eg:-
process.run("push");
process.run("update");
Is there any way to not show that window at all ?
Back in the day I used to have a tool that was hidewin.exe that would all you to start any bat file or exe file and have it run invisibly. I tried a google search for it but didn't find it easily but maybe you could have better luck at finding it.