OK done some more Holiday Bonus testing and found out some pretty important stuff.
To conclude: When your game uses Virtual Store it works fine for one windows account but does not work as expected for multiple windows accounts.
First install:
1) I installed the game on the main administrator account called Helen and the installer brought up the UAC prompt to boost its priviliges. The installer auto launched the game at the end because I left that option ticked.
2) I created a profile in my game and changed some options which wrote to the ini file.
3) I exited the game.
4) I went back into the game and made another profile and also changed some more ini options.
5) I exited the game and went back in and the new profile was there and the ini options were correctly applied.
6) Now it gets interesting ... I made a second Windows user account called Jake, I didn't give it administrator priviliges (although I don't think this has any bearing on the test results).
7) I switched to the new account and obviously Holiday Bonus didn't have an icon on the desktop (because the account was created after the game was installed) so I made a shortcut to it.
8) I ran the game. I noticed that the 2nd profile I made in the game was NOT there and the second batch of ini changes I made were NOT there. I made another profile (call it profile 3) and some ini changes.
9) I switched user back to Helen and ran the game. Profile 3 and the ini changes I made under account Jake were NOT there/applied.
10) This confirmed my suspicions about Virtual Store and about privileges. I went into the Program Files/Holiday Bonus folder and saw that the profile and ini changes I made when the program was first running under hightened user priviliges due to being launched by the installer were in that folder. But all subsequent profiles/ini changes were NOT.
11) I went to Users/Helen/AppData/Local/VirtualStore/Program Files/Holiday Bonus and found a secret little cache of files that Vista had made. The second profile I made when I ran Holiday Bonus separately from the intaller was here and so was a more up to date ini file with more recent changes.
12) Then I swapped users to Jake and looked in the Users/Jake/AppData etc and found the profile I made under that windows account and the ini changes I made too.
13) By the way, I tried going into Program Files/Holiday Bonus/ to manually modify the ini file but it wouldn't let me save it. In fact it wouldn't let me create any files in that folder even though I was logged on as Helen, the original user who has Adminstrator rights.
Uninstall:
- The Uninstall program (also Innosetup) promped for special privileges and then removed desktop icon, quicklaunch icon and folder from program files but it didn't remove the stuff in virtual store. I did this manually for a clean second test.
Second Install:
1) Installed under Helen account. Did NOT auto-launch the game from the installer this time.
2) Ran the game and created a profile and modified ini settings.
3) Checked Program Files/Holiday Bonus and there were No profiles and no ini changes this time because I didn't auto-launch the game from the installer remember? However the profile and the ini changes were found in VirtualStore as was expected.
4) Swapped to Jake account. Surprisingly there was no desktop icon for Holiday Bonus. So desktop and quicklaunch icons are not applied global by my innosetup installer script, perhaps I need a change there. Any advice?
5) Ran the game, it asked me to create a profile (remember there was none in Program Files/Holiday Bonys) and the ini settings were default. Naturally the new profile/ini settings were stored in Virtual Store.
6) I uninstalled the game whilst under the Jake account and was surprised to see that it worked fine and when I went back into Helen's account the game was indeed gone. It still didn't remove the VirtualStore stuff.
So basically if you run a game under one Windows account, Virtual Store works fine. Any files you create when the game is auto-launched by the installer are in the proper Program Files folder, but any subsequent files that the game makes are all stored in VirtualStore, but the game doesn't know any different and works fine.
However, if you swap to another user, they will only see the profiles and ini changes made when the game was launched by the installer and then any more profiles and ini changes that are made are stored under their VirtualStore and because the VirtualStore is NOT global to all users on the PC, if you change users the newest ini settings will not be used and you won't see a full list of player profiles!
This is why we *must* start to use the correct folders, for families that play our games and want to change profiles in-game and compare global highscores etc.
Bit of info on the graphics card. I ran with VSync off and got 80FPS in full-screen and 130FPS in Windowed mode (I guess it's faster because it's drawing to a much smaller area and not having to stretch it? but I'm not sure). OpenGL totally failed - it just gave me a white screen. Weirdly fading in and out with Alpha works, as in the white fades in and out smoothly but there are no graphics! Was disappointed that the Intel card did do OpenGL.
I found a setting in the Intel drivers that made it keep the correct aspect ratio for 800x600 so that it didn't expand to fill the screen. Note that it was off by default so most users will probably see a "fat" game until I code widescreen auto-detection and offer the option to display in the correct aspect ratio (or automaticcaly do that).
Just going to test out OpenAL on my AOTMG demo now...
To conclude: When your game uses Virtual Store it works fine for one windows account but does not work as expected for multiple windows accounts.
First install:
1) I installed the game on the main administrator account called Helen and the installer brought up the UAC prompt to boost its priviliges. The installer auto launched the game at the end because I left that option ticked.
2) I created a profile in my game and changed some options which wrote to the ini file.
3) I exited the game.
4) I went back into the game and made another profile and also changed some more ini options.
5) I exited the game and went back in and the new profile was there and the ini options were correctly applied.
6) Now it gets interesting ... I made a second Windows user account called Jake, I didn't give it administrator priviliges (although I don't think this has any bearing on the test results).
7) I switched to the new account and obviously Holiday Bonus didn't have an icon on the desktop (because the account was created after the game was installed) so I made a shortcut to it.
8) I ran the game. I noticed that the 2nd profile I made in the game was NOT there and the second batch of ini changes I made were NOT there. I made another profile (call it profile 3) and some ini changes.
9) I switched user back to Helen and ran the game. Profile 3 and the ini changes I made under account Jake were NOT there/applied.
10) This confirmed my suspicions about Virtual Store and about privileges. I went into the Program Files/Holiday Bonus folder and saw that the profile and ini changes I made when the program was first running under hightened user priviliges due to being launched by the installer were in that folder. But all subsequent profiles/ini changes were NOT.
11) I went to Users/Helen/AppData/Local/VirtualStore/Program Files/Holiday Bonus and found a secret little cache of files that Vista had made. The second profile I made when I ran Holiday Bonus separately from the intaller was here and so was a more up to date ini file with more recent changes.
12) Then I swapped users to Jake and looked in the Users/Jake/AppData etc and found the profile I made under that windows account and the ini changes I made too.
13) By the way, I tried going into Program Files/Holiday Bonus/ to manually modify the ini file but it wouldn't let me save it. In fact it wouldn't let me create any files in that folder even though I was logged on as Helen, the original user who has Adminstrator rights.
Uninstall:
- The Uninstall program (also Innosetup) promped for special privileges and then removed desktop icon, quicklaunch icon and folder from program files but it didn't remove the stuff in virtual store. I did this manually for a clean second test.
Second Install:
1) Installed under Helen account. Did NOT auto-launch the game from the installer this time.
2) Ran the game and created a profile and modified ini settings.
3) Checked Program Files/Holiday Bonus and there were No profiles and no ini changes this time because I didn't auto-launch the game from the installer remember? However the profile and the ini changes were found in VirtualStore as was expected.
4) Swapped to Jake account. Surprisingly there was no desktop icon for Holiday Bonus. So desktop and quicklaunch icons are not applied global by my innosetup installer script, perhaps I need a change there. Any advice?
5) Ran the game, it asked me to create a profile (remember there was none in Program Files/Holiday Bonys) and the ini settings were default. Naturally the new profile/ini settings were stored in Virtual Store.
6) I uninstalled the game whilst under the Jake account and was surprised to see that it worked fine and when I went back into Helen's account the game was indeed gone. It still didn't remove the VirtualStore stuff.
So basically if you run a game under one Windows account, Virtual Store works fine. Any files you create when the game is auto-launched by the installer are in the proper Program Files folder, but any subsequent files that the game makes are all stored in VirtualStore, but the game doesn't know any different and works fine.
However, if you swap to another user, they will only see the profiles and ini changes made when the game was launched by the installer and then any more profiles and ini changes that are made are stored under their VirtualStore and because the VirtualStore is NOT global to all users on the PC, if you change users the newest ini settings will not be used and you won't see a full list of player profiles!
This is why we *must* start to use the correct folders, for families that play our games and want to change profiles in-game and compare global highscores etc.
Bit of info on the graphics card. I ran with VSync off and got 80FPS in full-screen and 130FPS in Windowed mode (I guess it's faster because it's drawing to a much smaller area and not having to stretch it? but I'm not sure). OpenGL totally failed - it just gave me a white screen. Weirdly fading in and out with Alpha works, as in the white fades in and out smoothly but there are no graphics! Was disappointed that the Intel card did do OpenGL.
I found a setting in the Intel drivers that made it keep the correct aspect ratio for 800x600 so that it didn't expand to fill the screen. Note that it was off by default so most users will probably see a "fat" game until I code widescreen auto-detection and offer the option to display in the correct aspect ratio (or automaticcaly do that).
Just going to test out OpenAL on my AOTMG demo now...