Using an included command line exe in a C# program: what's the path? -
i searched , found fragments of answer. building tool distribution across studio. have .exe command line program ( tool converts asset formats ) inlcuded resource in vs project.
based on thread, set inluded .exe's "copy output directory" property "copy if newer"; included when others install it.
now want call executable, arguments, passing string built command line, such
"c:\path\to\myprogram.exe -inputfilename -outputfilename -options"
the problem: need c:\path\to\myprogram.exe ? command line executable going end installed on end user's machine?
or embedding resource open new way of calling it(with args)?
copying output folder guarantees "resource" have relative location executable. method of copying output folder, can use following code location of main executable:
string basedir = path.getdirectoryname(assembly.getexecutingassembly().location); at point can use
path.combine(basedir, "myprogram.exe") to final path. if in "tools" folder, have include in second argument (that argument relative path seperate program). command line arguments go processstartinfo object.
Comments
Post a Comment