2

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#?

Community
  • 1
  • 1
jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182

1 Answers1

2

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).

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • I'll try it, if all we have to do is write one function in C++, we should be able to get it working. – jonathanpeppers Mar 07 '11 at 15:45
  • Well, we first tried it with ExitWindowsEx, which didn't seem to do anything. So next we were going to try KernelIoControl as your link suggests, but it complains about the new include file we added: "pkfuncs.h" says it cannot be found. What we need to change in the project settings to get this header file to work? Again we don't have much experience with C++. – jonathanpeppers Mar 07 '11 at 16:44
  • You don't really need the pkfuncs.h file (it's the private kernel functions header). Just define the pieces you need expilicitly - probably an `extern` definition for the API and a `#define` for the IOCTL value. – ctacke Mar 07 '11 at 19:38
  • We actually found a WARMBOOT.EXE and we got it to work by running that process. Thanks for the help. – jonathanpeppers Mar 07 '11 at 22:36