screen saver application when deployed in C:\Windows\System32 throws exception

1.1k views Asked by At

I wrote a wpf application to create a screensaver, i rename the exe to scr. i am able to run it from bin directory or if i copy it to d directory.

but when copy it to C:\Windows\System32 and try to run it from cmd prompt or I launch it from Control Panel > All Control Panel Items > Personalization > Screen Saver it thorws an exception, click here for screen shot.

I am working on windows 8 machine.

Thanks

1

There are 1 answers

0
Shashank Bisen On

The problem is that the screensaver was compiled for 32bit cpu. Only 64bit exes are allowed in the %WINDIR%\System32 folder on a 64bit OS. Which in fact, i was using Windows7 64bit.

The correct place to put 32bit screensavers is in %WINDIR%\SysWOW64 or compile using 'AnyCPU' option in Visual Studio then you can install into the %WINDIR%\System32 for all.