NOTE: Before running this example, you must first put a copy of the JPEPortable.exe in the FreeCell directory and rename it to freecell.exe.

This example presents the use of the new "no annoyers" capability, which gives you a way to eliminate certain types of bad behaviors of an application.

The ini itself...


The Launch section

This section's settings are read by the JauntePE-built app launcher and each overrides its equivalent stored within the launcher executable file.

[Launch]
Path=%System%\%appname%.exe
JPERuntime=..\..\Runtime\jauntePE\def\jauntePE.dll
JPERuntimeIni=.\%appname%_jauntePE.ini
ExeDir=0

The rest of this file's sections are all JauntePE runtime ini sections and are read by the JauntePE runtime dll and again, used to override equivalent settings stored within the launcher executable file.


The Redirection section

The in-memory portable registry used in this example is a version that does not write changes out to the .reg file, ever. That version was chosen after the settings were initially changed to their preferred values and then saved off to the portable registry. Now, temporary changes can be made to the settings on a by-session basis without affecting the permanent, preferred values.

[Redirection]
UseIcon=1
ModFrame=1
FlashDisco=1
IconDisco=1
MemRegistry=4
;Logging=1
;LogFuncs=1
;LogPath=.\%appname%_jauntePE.log


The Registry section

Since this example is for a simple game, there is no need for additional registry-related settings other than to turn on registry portablization.

[Registry]
Use=1
Data=.\%appname%.reg


The Hook sections

These sections specify the only registry API functions that need to be hooked for this application to be properly portablized, giving it a performance boost.

[HookExclude]
1=*

[HookInclude]
1=RegCloseKey
2=RegCreateKeyA
3=RegCreateKeyW
4=RegDeleteValueA
5=RegDeleteValueW
6=RegFlushKey
7=RegQueryValueExA
8=RegQueryValueExW
9=RegSetValueExA
10=RegSetValueExW


The NoAnnoyers sections

Since this example is about using the new "no annoyers" capabilities of JauntePE, obviously the first thing to do is to turn that feature on. In doing so, FreeCell is prevented from flashing its game window when it thinks you're in a losing position. The No Annoyers section has a full list of the prevented annoyances when this feature is turned on.

The rest of the sections, the NoAnnoyersDialog? sections, are all there to deal with a number of annoying confirmation message and dialog boxes. As you can see, having a message or dialog box auto-answered is fairly straightforward. Just make sure you enter enough of the box's title and enough of one of its control's text, to uniquely identify it amongst the rest of the application's message and dialog boxes.

Actually, using this example, if both of the "Game Over" dialog boxes were to be auto-answered the same way, the 3rd and 4th NoAnnoyersDialog? sections could be combined into one with a Text value of "Do you want to play again?", since both dialog boxes have the same title and have that same text string within one of their control's text.

[NoAnnoyers]
Use=1

[NoAnnoyersDialog1]
Use=1
Title=FreeCell
Text=Do you want to resign this game?
Answer=6

[NoAnnoyersDialog2]
Use=1
Title=FreeCell
Text=Are you sure you want to delete all statistics?
Answer=6

[NoAnnoyersDialog3]
Use=1
Title=Game Over
Text=Sorry, you lose.There are no more legal moves.\nDo you want to play again?
Answer=7

[NoAnnoyersDialog4]
Use=1
Title=Game Over
Text=Congratulations, you win!\n \nDo you want to play again?
Answer=6