How do I add/update a property inside an MSI from the command-line?

Example VBScript that you could use to update (or add) a property post-build… Option Explicit Const MSI_FILE = “myfile.msi” Dim installer, database, view Set installer = CreateObject(“WindowsInstaller.Installer”) Set database = installer.OpenDatabase (MSI_FILE, 1) ‘ Update Set view = database.OpenView (“UPDATE Property SET Value=”” & myproperty & “” WHERE Property = ‘MYPROPERTY'”) ‘ .. or Add … Read more

What will give me something like ruby readline with a default value?

What you are asking is possible with Readline. There’s a callback where you can get control after the prompt is displayed and insert some text into the read buffer. This worked for me: Readline.pre_input_hook = -> do Readline.insert_text “hello.txt” Readline.redisplay # Remove the hook right away. Readline.pre_input_hook = nil end input = Readline.readline(“Filename: “, false) … Read more

What’s the difference between -cp and -classpath

They are the same, check http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html -classpath classpath -cp classpath Specifies a list of directories, JAR files, and ZIP archives to search for class files. Separate class path entries with semicolons (;). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment variable. If -classpath and -cp are not used and CLASSPATH is not … Read more

Command Line Pipe Input in Java

By executing “java Read < input.txt” you’ve told the operating system that for this process, the piped file is standard in. You can’t then switch back to the command line from inside the application. If you want to do that, then pass input.txt as a file name parameter to the application, open/read/close the file yourself … Read more

Testing console based applications/programs – Java

Why not write your application to take a Reader as input? That way, you can easily replace an InputStreamReader(System.in) with a FileReader(testFile) public class Processor { void processInput(Reader r){ … } } And then two instances: Processor live = new Processor(new InputStreamReader(System.in)); Processor test = new Processor(new FileReader(“C:/tmp/tests.txt”); Getting used to coding to an interface … Read more