Search code examples
c#visual-studio-2008windows-cecabcompact-framework

Reboot after installation from CAB using NET Compact Framework


We need to reboot a Windows CE device after installation of our CAB file. We basically created a smart device CAB project in Visual Studio 2008. We are developing in C#.

I have seen examples of modifying MSI properties in Stack Overflow question How can I prompt the user to reboot in a .NET installation?. So I was going to try setting this MSI property in Orca.exe. But CAB files don't seem to open in Orca.exe, so I assume it isn't an option for CAB files on smart devices.

I also see an example of making it happen in C++, Stack Overflow question Reboot on installation of .CAB WM, but we would rather avoid using C++. There isn't an option for C# custom actions for smart devices either.

Is there a setting or some way for us to do this in C#?


Solution

  • There's nothing you can do in C# for this, no. The CAB file is unpacked and parsed by wceload. If you need to do any custom actions, you must use a custom setup DLL, which must be written in C. That said, what you're after is not at all complex, so writing it in C really shouldn't be a problem. You simply need to add the soft reset call to Install_Exit (probably after checking that nothing failed).