I am trying to call msival2.exe on a MSI file and it successfully performs the ICE testing. However, the error code is always -1 and I can't seem to figure out why. To test, I made a simple batch file which has the following code: @ECHO OFF msival2.exe "C:\test\myMSI.msi" Darice.cub if NOT errorlevel 0 goto failure :failure echo Error level is %errorlevel% > c:\blah.log Errorlevel always shows -1 even though msival2.exe outputted correct information. For simple testing, I ran this batch file from the msival2 directory (c:\program files\msival2\). That directory also contains Darice.cub. Any thoughts?
[Please do not mail me a copy of your followup] =?Utf-8?B?Sm9uYXRoYW4gTg==?= <Jonathan N@discussions.microsoft.com> spake the secret code thusly: >To test, I made a simple batch file which has the following code: > >@ECHO OFF >msival2.exe "C:\test\myMSI.msi" Darice.cub >if NOT errorlevel 0 goto failure > >:failure >echo Error level is %errorlevel% > c:\blah.log Try this: @ECHO OFF msival2.exe "C:\test\myMSI.msi" Darice.cub if NOT errorlevel 0 goto failure goto done :failure echo Error level is %errorlevel% > c:\blah.log :done Does that still execute the :failure block? -- "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download <http://www.xmission.com/~legalize/book/download/index.html> Legalize Adulthood! <http://blogs.xmission.com/legalize/>
I actually figured out the problem. If any of the ICE's return a error, then msival2.exe will return -1 to indicate that there was an error found in your MSI. I was thinking -1 meant something went wrong with msival2.exe. If you run msival2.exe on a MSI without errors, error code is 0. "Richard [Microsoft Windows Installer MVP" wrote: > [Please do not mail me a copy of your followup] > > =?Utf-8?B?Sm9uYXRoYW4gTg==?= <Jonathan N@discussions.microsoft.com> spake the secret code > thusly: > > >To test, I made a simple batch file which has the following code: > > > >@ECHO OFF > >msival2.exe "C:\test\myMSI.msi" Darice.cub > >if NOT errorlevel 0 goto failure > > > >:failure > >echo Error level is %errorlevel% > c:\blah.log > > > Try this: > > @ECHO OFF > msival2.exe "C:\test\myMSI.msi" Darice.cub > if NOT errorlevel 0 goto failure > goto done > > :failure > echo Error level is %errorlevel% > c:\blah.log > > :done > > Does that still execute the :failure block? > -- > "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download > <http://www.xmission.com/~legalize/book/download/index.html> > > Legalize Adulthood! <http://blogs.xmission.com/legalize/> >