Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Launching Silent Installs from C#


4 replies to this topic

Graeme Yallop

Graeme Yallop
  • Members
  • 4 posts

Posted 12 July 2005 - 20:42

I'm working on a project where I have to install multiple things from different sources. Some are InstallShield projects some are MSI's.

I've written a C# application that launches each installer silently and waits for it to finish.

It uses the System.Diagnostics.Process object and calls the start method and waits for the process to complete before launching the next one.

This is working great for all the MSI's and InstallShield 9 setups.

I've hit an issue with an InstallShield 5.5 project. If I try to run the silent install like I am for the InstallShield 9 setups the setup.exe starts but doesn't do anything. The log file is not created and the setup.exe process doesn't take any CPU cycles.

If I run the silent install from a batch file it runs correctly but the really interesting this is that if I run the silent install batch file from the C# application it still hangs.

Upgrading the 5.5 project to 9 is not an option.

Any help would be appreciated.
Graeme Yallop[br]Software Developer

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 13 July 2005 - 13:32

during initialitation IS 5.5 setup send broadcast messages. Make sure your C# app polls and processes such messages in a timely way. Otherwise your IS 5 setup can significantly slow down or stall because it waits for these messages to be processed (it is using SendMessage instead of PostMessage).

See also bug report Setup initialization extremely slow when MAPI software is running at http://www.installsi...s_is5.htm#isp5x

Graeme Yallop

Graeme Yallop
  • Members
  • 4 posts

Posted 14 July 2005 - 17:56

Thanks. I added do events between checks for the process to be complete and it is running the setup correctly.

One thing that I have noticed though is that the Setup.exe process exits before the install is finished. I need to wait for a bit after the Setup.exe process is gone and do another do events before the installation is complete.
Graeme Yallop[br]Software Developer

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 16 July 2005 - 15:23

Launch setup.exe with the /SMS (all upper case) command line parameter to keep it alive until the install is finished.

camelinckx

camelinckx
  • Members
  • 1 posts

Posted 03 August 2005 - 15:25

Thanks a lot Stefan and Graeme, I just had the same problem with the MDAC 2.8 Installer. I am installing it from a C# piece of code and it was hanging and I was already running out of options on why would this be, adding the periodic call to Application.DoEvents() made it work.

I do have one more concern. In the waiting loop I've implemented [into which I've just added the .DoEvents() call] I check for the registry key value \\KLM\Software\Microsoft\DataAccess\Version until it is updated. After this I would like the code to delete the temporary files I've downloaded, but I am not exactly sure if the whole MDAC setup has finished once this registry key has been updated, therefore I am concerned about deleting the setup files before the installation is done using them. Does anybody know how to deterministically know the MDAC setup has finished. Recall the Process object for setup.exe returns right away much earlier.

Thanks,

Chris.-