3
Start-Process "msiexec.exe" -arg "/a $MsiPath /qn TARGETDIR=$TargetDirectory"

This line is part of powershell script of msi(say a.msi). While running a.msi it would call the above script, which is expected to extract contents of b.msi($Msipath) to TARGETDIR. But it is not extracting as expected, looks like the above line is not executed at all. Directly when i try to run the above script it is extracting the contents of b.msi as expected. but through msi package it is not working.

I tried removing /qb argument from the above command, and found that it is extracting files now. Since i am calling this script while running a.msi, i am getting a warning "Another installation is in progress. you must complete continuing this one " with Retry and cancel option. When i click on Retry it extracts b.msi and stores in TargetDirectory , on cancel it cancels extracting. So im doubting is it possible to call msiexe.exe when running msi package?

Instead of using msiexec.exe is there any way to extract files from msi?

Rem San
  • 367
  • 1
  • 5
  • 20
  • Are the arguments passed correctly to the script? Would any party require admin rights? – T-Me Jul 23 '19 at 07:08
  • I am running with admin privilege. Arguments seems to be right otherwise it would have failed when running this script directly instead from msi. – Rem San Jul 23 '19 at 07:13
  • Have you tried running in an admin PowerShell prompt? Do you get any errors? Please double check your paths and that you have access/permissions to them – I.T Delinquent Jul 23 '19 at 08:02
  • is it able to create a txt file at `$TargetDirectory` containing `$MsiPath` ? Not from your powershell session but from within a.msi. + maybe even add `$Error` to the txt file to see if there are errors – T-Me Jul 23 '19 at 08:13
  • I tried removing /qb argument from the above command, and found that it is extracting files now. Since i am calling this script while running a.msi, i am getting a warning "Another installation is in progress. you must complete continuing this one " with Retry and cancel option. When i click on Retry it extracts b.msi and stores in TargetDirectory , on cancel it cancels extracting. So im doubting is it possible to call msiexe.exe when running msi package? – Rem San Jul 23 '19 at 08:44
  • instead of using msiexec.exe is there any way to extract files from msi? – Rem San Jul 23 '19 at 09:50
  • @RemSan best to edit the question or make a new question. Questions in the comments tend to not be seen... – T-Me Jul 23 '19 at 10:32
  • @RemSan, have you tried adding `-Credential` parameter? – Kirill Pashkov Jul 23 '19 at 14:16
  • updated the question, thanks @T-Me – Rem San Jul 24 '19 at 02:19
  • @KirillPashkov, it does not look like privilege issue. As i am running in admin mode itself, otherwise like i mentioned earlier it would have failed when running script directly, but that is not happening. So, to me it looks like since im starting msi process from another msi installation, this is not working. – Rem San Jul 24 '19 at 02:21

0 Answers0