Source language: Translate to:

What are new rules for screen savers?

General questions about NeoBook

Moderator: Neosoft Support

What are new rules for screen savers?

Postby Enigman » Sun Jan 11, 2015 12:30 pm

I am resurrecting a screen saver product of mine that has not been updated in ten years. It was originally made in the Windows 98/XP days. I recently decided to finally bring it into spec for Windows Vista, 7, and 8 (even though I dislike 8 intensely) and I am discovering that the game has apparently changed for screen savers.

I used to save the registration details in multiple registry keys. That no longer works after XP. I also saved a backup copy of the registration in the Windows/System directory. That no longer works after XP. I also saved the INI file in the Windows directory. THAT no longer works after XP. So obviously the User Account Control system has changed the game.

If I compile the saver as an EXE file and set it to "run as administrator", then some of the things work, but not all. But as a SCR file outside the Windows directory, none of the above functions work. If I copy the SCR file and the flash file into the Windows or Windows/SysWOW64 directory, then the INI file is created, but nothing else. Also if I try to set the SCR as the screen saver for automatic use by selecting it from the list of savers, it doesn't work at all. There is no image on the screen saver dialog, the settings button does not open the settings, and the preview button does not run the screen saver. It used to be that you just needed a page called "config" and clicking settings from the Screen Saver dialog would run the saver and jump to that screen. The system also does not run the saver automatically when the time to wait is exceeded.

In short, even though it still works in XP, it does not work at all in Win 7.

Any pointers would be appreciated. Thanks.

So, can anyone tell me ... what are the new rules for screen savers?
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Enigman » Mon Jan 12, 2015 2:32 pm

UPDATE 1/12:

I have discovered that Windows is quietly altering my registry keys and putting them in another location. It changes "SOFTWARE\Enigma Creations\Kaleid-O-Space\ProgramDir" to "SOFTWARE\WOW6432node\Enigma Creations\Kaleid-O-Space\ProgramDir". Literally any registry key I define gets altered in that way and can be read back using my original spec.

I have not yet been able to write a file in the System or SysWOW directory from an SCR file. It's possible that files are being redirected as well, but I haven't found any.

None of this changes anything. If I drop the SCR file in either the Windows or SysWOW directory, the display dialog sees the file and adds it to the list of available screen savers, but it will not run or go to setup in any way.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Neosoft Support » Mon Jan 12, 2015 6:34 pm

For Windows 7 and 8, screen savers must be installed differently. Newer versions of Windows will generally not allow you to create or store files in the Windows folder. So instead of attempting to copy the scr file to the Windows folder, you should copy it somewhere else (a folder under "Program Files" for example). Then install it by right clicking on the .scr file and choosing "Install" from the popup menu. After that, the screen saver will appear in the Control Panel's Screen Saver screen. (Make sure that the Control Panel is not open when you install the screen saver or it will not appear in the list until you close and reopen the Control Panel.) Once you install the screen saver it should work as it did under XP.

I used to save the registration details in multiple registry keys. That no longer works after XP. I also saved a backup copy of the registration in the Windows/System directory. That no longer works after XP. I also saved the INI file in the Windows directory. THAT no longer works after XP. So obviously the User Account Control system has changed the game.


You can no longer save files in the Windows folder. You can save files in the "Application Data" folder (create your own subfolder there), or you can save files under the user's Documents folder.

Finding the Application Data folder: https://answers.microsoft.com/en-us/windows/forum/windows_7-performance/where-can-i-find-application-data-folders-in/26f4d163-7340-4974-b513-72bfcd1f54a5

I have discovered that Windows is quietly altering my registry keys and putting them in another location. It changes "SOFTWARE\Enigma Creations\Kaleid-O-Space\ProgramDir" to "SOFTWARE\WOW6432node\Enigma Creations\Kaleid-O-Space\ProgramDir". Literally any registry key I define gets altered in that way and can be read back using my original spec.


Windows alters your registry keys because you're using a 32-bit app on a 64-bit version of Windows. I'm not sure why Microsoft felt this was necessary, but that's what they decided to do. Generally, this is handled automatically by Windows in the background and the 32-bit app doesn't know it's happening and continues to function. Windows should read and write the keys as if you're running on a 32-bit system.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: What are new rules for screen savers?

Postby Enigman » Mon Jan 12, 2015 9:16 pm

For Windows 7 and 8, screen savers must be installed differently. Newer versions of Windows will generally not allow you to create or store files in the Windows folder. So instead of attempting to copy the scr file to the Windows folder, you should copy it somewhere else (a folder under "Program Files" for example). Then install it by right clicking on the .scr file and choosing "Install" from the popup menu. After that, the screen saver will appear in the Control Panel's Screen Saver screen.

Okay, well ... I don't really want to tell a user installing the program to browse to the program directory and right click the SCR and click install (90% of the public would not be able to do that), so this needs to be handled by the installer program. I can't imagine that this is the way all screen savers are installed.

During testing now I have manually copied the SCR to both the windows directory and the SysWow directory and in both cases it is picked up by control panel and put on the list of savers. Likewise I have tried the right click and install method and it also put it in the list, although it should be noted that doing that installs absolutely ALL SCR files in the same directory as well.

My original installer for 98/XP put everything in a directory under "Program Files" and then copied only the SCR file to Windows. A registry entry told the SCR where to find the rest of the files including the flash movie. Then a program was called after install that made the screen saver the active saver. That always worked fine. Unfortunately the player I was using was not supported under Vista and beyond so that's when things went off the rails.

But now, with the screen saver using the NB player it runs on win 7 when I double-click the SCR file or in debug mode from the editor, and through manual emulation of what the old installer did, it looks like the same process should still work if the installer has enough privilege to copy the SCR to Windows SysWow. If not then I can call a post install EXE with admin privilege to complete the install.

What I am fighting now is that with the saver on the list of available savers, when I select it, literally NOTHING about it works. Not the sample screen image, the config screen, NOTHING.

I am at a loss about why.

You can no longer save files in the Windows folder. You can save files in the "Application Data" folder (create your own subfolder there), or you can save files under the user's Documents folder.

I solved this by switching to the [TempDir] directory. That system variable should work in all versions of Windose.

Windows alters your registry keys because you're using a 32-bit app on a 64-bit version of Windows. I'm not sure why Microsoft felt this was necessary, but that's what they decided to do. Generally, this is handled automatically by Windows in the background and the 32-bit app doesn't know it's happening and continues to function. Windows should read and write the keys as if you're running on a 32-bit system.

Yup, after some searching of the registry I found this is true and now all registry functions work fine now that I know where to look for them, and using the original key spec should work for XP and Windows can do what it wants for 7 and 8.

So now everything in the saver works under Windows 7 so long as I run it by double-clicking the SCR, but when running it from the control panel display dialog it does not run at all. It's as if it cannot find the file even though it is on the list. It doesn't even see the sample image.

Any idea why it would not run from the display dialog? How can I chase this down?

Thanks.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Neosoft Support » Tue Jan 13, 2015 12:11 pm

Okay, well ... I don't really want to tell a user installing the program to browse to the program directory and right click the SCR and click install (90% of the public would not be able to do that), so this needs to be handled by the installer program. I can't imagine that this is the way all screen savers are installed.


I would think that an advanced installer like InnoSetup would take care of that.

What I am fighting now is that with the saver on the list of available savers, when I select it, literally NOTHING about it works. Not the sample screen image, the config screen, NOTHING.


I'm not sure. I tried creating a simple test screen saver and installing it under Windows 7 (using the right click method). Everything appears to work correctly. The config page and preview both work as expected from the Control Panel.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: What are new rules for screen savers?

Postby Enigman » Tue Jan 13, 2015 12:30 pm

I would think that an advanced installer like InnoSetup would take care of that.

I use InnoSetup already so I was already going to convert my old Wise installer routine.

I'm not sure. I tried creating a simple test screen saver and installing it under Windows 7 (using the right click method). Everything appears to work correctly. The config page and preview both work as expected from the Control Panel.

Have you ever tried a screen saver with the FlashPlayer object in it? Something in the back of my mind is nagging me about that. The code on the revised saver is basically the same as the old one, except that I am using the native FlashPlayer now. The old one still displays the sample in the dialog and tries to start (but fails due to the old player) while the new one doesn't. Is it possible that a new "rule" in Windows is that flashplayers are not supported or allowed? If so that might be why the old saver stopped working instead of my assumption that the player was obsolete.

Sigh ... :roll:
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Neosoft Support » Wed Jan 14, 2015 11:20 am

Is it possible that a new "rule" in Windows is that flashplayers are not supported or allowed?


That's a possibility. Maybe it has something to do with Windows UAC or security settings? Does it make any difference if the Flash content is left external?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: What are new rules for screen savers?

Postby Enigman » Wed Jan 14, 2015 11:40 am

That's a possibility. Maybe it has something to do with Windows UAC or security settings?

OMG ... you never tested a screen saver with the flash player in Vista thru 8? :cry:

Ooooooo ... kay. So I guess I am going to have to try building a saver from scratch and keep adding objects and functions until it doesn't work, and then I'll know. But not really know ...

Does it make any difference if the Flash content is left external?

??? Uh ... what else can it be but external? The SWF file is in the program directory and is referenced from inside the screen saver. I didn't compile it inside if that's what you mean?
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Enigman » Wed Jan 14, 2015 9:17 pm

UPDATE:

I have made a small saver from scratch with nothing in it but a flash player and a config page that is empty. The player calls the flash movie as an external object and I can run my flash movie as well as others from this small saver. It works as expected from the screen saver dialog. Windows sees the sample image and can call the config page.

That means that a flash player is NOT the problem. That only leaves some kind of script code that Windows doesn't like, or something that is compiling into the SCR. Windows still treats the full saver as if it cannot read any internal details.
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Neosoft Support » Thu Jan 15, 2015 11:44 am

That's good information. It could be some code or a plug-in in the full screen saver that Windows doesn't like. You will just have to experiment by adding elements one at a time to find the source of the problem.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: What are new rules for screen savers?

Postby Enigman » Thu Jan 15, 2015 3:54 pm

UPDATE:

Okay then. I have carried out a systematic rebuild of the saver. I started with a new empty pub, then copied each page and associated code into the new pub one at a time. After each page was created I compiled to a unique name and tested the saver from the Windows screen saver dialog. It took 12 versions of the test pub to copy and test each stage along the way. Each time everything worked as planned. Finally I reached the point where everything had been duplicated in the new pub file, and it still worked as designed.

I think I would rather have found a problem than to simply rebuild the saver piece by piece and have it work every single step along the way. That doesn't teach us anything. On the bright side, my saver now works as intended under Windows 7 instead of being limited to XP.

My suspicion was that since I had opened a pub file that hadn't been touched in over ten years, something in the pub was persistently out of date. So I then used a programming editor and opened the old pub file and compared it to the new pub file. The only difference I found was one parameter in the header area of the file. The old non-workng file had "WindowProps=59", while the new working file had "WindowProps=27".

Dave? Can you chime in on what that parameter does? Other than that, I don't have a clue WHAT was keeping the old one from working from the screen saver dialog, but at least now I am back on the path to finishing this upgrade of my saver product. :D
User avatar
Enigman
 
Posts: 314
Joined: Tue Apr 12, 2005 3:57 pm
Location: Foothill Ranch, CA

Re: What are new rules for screen savers?

Postby Neosoft Support » Fri Jan 16, 2015 11:42 am

The WindowProps entry in the pub file contains information about the style of the pub window. This includes whether the window has a title bar, scroll bars, close button, etc. I don't know why this would make any difference for your screen saver, but obviously it had something to do with it. Anyway, I'm glad you resolved the problem.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 2 guests