Problems making a silent install within a Cusom Action in C# -
i want silently install application named instacal within custom action written in c#. in custom action installing other applications , works fine(they not silently installed!).
when silent installation of application named instacal started, nothing ever installed(i check programs , features). in custom action following:
int ms = 0; // execute instacal silently - must present on user machine! var filename = path.combine(folder3rdparty, @"instacal\instacal.msi"); process installerprocess; installerprocess = process.start(filename, "/q"); while (installerprocess.hasexited == false) { streamwriter file = new streamwriter("c:\\test.txt", true); file.writeline("ms: " + ms); file.close(); thread.sleep(250); ms += 250; }
i writing file test how long time installaltion approximately takes. takes 3 seconds in while loop , afterwards nothing installed.
but if use same code in small console application application instacal succesfully installed silently. installation take 9 seconds complete.
so, doing wrong in code? missing important regarding custom actions? thx :)
i suggest change code following:
this uses msiexec command install package instead of calling msi directly.
int ms = 0; // execute instacal silently - must present on user machine! var filename = path.combine(folder3rdparty, @"instacal\instacal.msi"); process installerprocess; installerprocess = process.start("msiexec", string.format("/i '{0}' /q", filename)); while (installerprocess.hasexited == false) { streamwriter file = new streamwriter("c:\\test.txt", true); file.writeline("ms: " + ms); file.close(); thread.sleep(250); ms += 250; }
Comments
Post a Comment