batch file - CMD-Script stops execution after one second -
i'm trying call ngen cmd-script create native image of application installed innosetup. run said script calling shellexec in curstepchanged function when curstep sspostinstall. script looks location of ngen , calls path of application parameter. problem script stopped after aprox. 1 second without errors. shellexec returns true , logfile created script empty.
here details: innosetup:
procedure curstepchanged(curstep: tsetupstep); var param : string; resultcode : integer; begin if curstep=sspostinstall begin try progresspage.setprogress(0,2); progresspage.settext('tell application database',''); progresspage.show; exec(expandconstant('{tmp}') + '\xmlandinireplacer.exe',expandconstant('{app}')+'\application.exe.config'+ ' ' +dbpage.values[0] + ' ' + dbpage.values[1] + ' ' + dbpage.values[2] + ' ' + dbpage.values[3] + ' ' + expandconstant('{app}')+'\application.ini' + ' ' + expandconstant('{language}'),'', sw_hide, ewwaituntilterminated, resultcode) progresspage.setprogress(1,2); progresspage.settext('make application faster ','this operation take few minutes'); param := '"' + expandconstant('{app}') + '"'; if not shellexec('', expandconstant('{tmp}') + '\ngen-run.cmd', param,'', sw_show, ewwaituntilterminated, resultcode) begin msgbox(syserrormessage(resultcode), mberror, mb_ok); end; progresspage.setprogress(2,2); progresspage.hide; end; end; end;
cmd-file:
for /f "tokens=3* delims= " %%a in ('reg.exe query hkey_local_machine\software\microsoft\.netframework /v installroot') set "utilpath=%%a\v4.0.30319\ngen.exe" echo %1 echo %2 echo %utilpath% %utilpath% %2 %1\application.exe > ngen.log
everything works fine, it's script called, open second, , closes without telling me anything. there no native image single second several megabyte heavy .exe ridiculously fast. black magic casted in cmd-file work of else. can't tell happens in there. know, calls ngen application parameter. far worked fine. whats wrong here?
to clear things up, solved letting innosetup work script would've done. extracting ngen path registry, running ngen correct path parameter. way can control ngen doing, , have 1 less thing of don't know how works.
Comments
Post a Comment