Menù Principale

Cerca
Login
Registrati
Link
<< Discussione precedente | Discussione successiva >>   
[Translation-English] Regshot User Guide

Autore Messaggio
MarsC
gio 25 giu 2009 - 00:58
online
Utente registrato #27846
Registrato il: mer 27 mag 2009 - 03:27
Messaggi: 3

Regshot User Guide

Download the version in X-Software format:
Download X-RegShot

To test a program portability, one needs to ensure that it does not write its settings into the registry or to files (either auxiliary or temporary) in user or system directories of the host PC. This condition ensures total portability. But this means having to control all the configuration of the host PC before and after installation, which may not always be easy or practical (not to mention that some things may escape even the most strict control). To help those in need to perform such tests some Open Source utilities have been created, among which there is Regshot, the subject of this tutorial.
Regshot is one of the major utilities to determine the portability of a hypothetical program (for simplicity's sake, let's call it WPP_TEST) and does it by allowing the user to compare the configuration of his PC before and after the execution of WPP_TEST.
There is a main version of Regshot ( -Link- ) (at the time of this writing, it is currently 1.8.1, after a long period at version 1.7) and a fork ( -Link- ) (from Paraglider, version 1.7.2.5), slightly changed from the official 1.7 but no longer developed nor supported.
I based this tutorial on version 1.8.1 (in Italian), but "borrowed" from Paraglider some interesting changes to the .ini file.

1 - Preparation of the test enviroment

WPP_TEST could make changes in the configuration of the host PC during the installation phase. For this reason, it is well not to install it at all (if possible). To this end you can use two programs: Universal Extractor (http://legroom.net/software/uniextract) and, if it doesn't succeed (mainly with setups created with Inno Setup), IsUnp ( -Link- ). Through these utilities, to which you can pass the setup of WPP_TEST as a parameter, you can extract the entire contents of the setup files and directories to a temporary directory, from which you'll need only (usually, but this could be the theme for another, more specific, tutorial...) the [app] directory, that contains precisely the main program as shown in your "Programs" directory (or "Program Files") after the installation. At this point, you can copy the contents of the [app] directory (note: not the directory itself, but its contents) to any directory of your PC and delete everything that was generated by EU or IsUnp.

Note: If the program installation is unavoidable, you should have the foresight to use Regshot (as we will see below) to compare the configuration of the host PC before and after installation, to discover any changes made (to be taken into account in the final report).

2 - Getting to know Regshot

Running Regshot, the following main screen is presented:


As you can see, it has a compact but complete interface. For our purposes, the interesting bits are the buttons to the right and the fields "Scan dir1 [, dir2 ;...; nn dir]" and "Destination Directory". The latter allows us to tell Regshot the directory where to save its temporary files, while the former allows us to tell Regshot which directories to check. To add a new directory (at the end of the list) simply press the button "..." next to the field, look for the directory and press OK to confirm. Alternatively, you can do this manually by writing at the end of the field, remembering, however, to separate between different directories inserting a ";" (this should not be inserted after the last one, at the end of the list).
The buttons that we are interested in are "1st shot", "2nd shot", "Compare" and "Clear". The first two are used (as their names suggest) to "photograph" the configuration of your system in two stages. The third (an essential one) is used to compare these results with each other and then shows the comparison in a text file. The fourth button cleans any temporary files generated by Regshot during the "shot" stages.

[back to top]
[go to page 1-2-3]

3 - Running the test

First you have to run Regshot. The first step is to make a "snapshot" of the current configuration, so you click on the button "1st shot" and, from the context menu, choose "Shot"

and wait for Regshot to finish scanning the registry and directories.
[*NOTE: in the Italian page the URL of this picture is wrongly coded - <http://www.winpenpack.com/main/e_PLUGINScontent/images/image/16_regshot3.jpg> - the correct one, as seen above, is <http://www.winpenpack.com/main/e107_plugins/content/images/image/16_regshot3.jpg>*]

As you can see, it is listed below registry keys and values, first, and directories and files verified, plus the time taken for the first shot (which depends greatly on the load of your PC at that time and therefore may vary significantly).

Note: You can also do "Shot and save...", but in this case the entire configuration is saved to disk and it could generate a really huge file (so this is only useful in very specific circumstances). You can safely ignore this option (like the "Load..." to load a file saved with "Shot and save..."). The same also applies to "2nd shot".

At this point Regshot has a snapshot of the system configuration and we can run WPP_TEST. Let us run it, use it and, particularly, change its options to see where they are saved. This phase is left to your "creativity" (or experience), but remember not to run, as far as possible, any other program until after the second shot, otherwise you may find too many differences to be verified at the comparison stage.

Once WPP_TEST is closed, you are ready to run the "2nd shot" in a manner quite similar to what was done in the "1st shot". Hence

and then


And now you got to the final stage. Press the button "Compare" and wait it to finish. In the end, a text file will be generated and shown through Notepad. Save it (for example, as WPP_TEST.log) so you can perform your analysis. Press the button "Clear" and, from the context menu, "Clear" again. This will delete all temporary files of the two shots. At this point you can finish with "Exit" (or, if you want to test something else, Regshot is ready to perform the "1st shot" again).

[back to top]
[go to page 1-2-3]

4 - Checking for portability

This is certainly the most delicate phase of the analysis, because it is left entirely in your charge the interpretation of the results and the determination whether WPP_TEST is portable or not.
First, you must exclude all that is not directly connected to WPP_TEST (both registry keys and directories/files). Or, if you prefer, focus only on what is shown that relates to WPP_TEST. A first criterion is to to look for the string WPP_TEST in your logs. Of course, WPP_TEST appearing or not, it is certainly possible the existence of subkeys and/or subdirectories related to it (even if they do not contain the string WPP_TEST).

4a) Registry
If you find "WPP_TEST" among the registry entries, you can ignore all that contain the following strings: RunMRU, OpenSaveMRU, MUICache. If, in addition to these, "WPP_TEST" does not appear in any log entry, you can definitely say, almost certainly, that it is portable (relative to the registry).

Conversely, assuming the company that distributes WPP_TEST is called WPP, if you find the following keys (or similar) and any subkeys:

HKU\[number]\Software\WPP
HKU\[number]\Software\WPP\WPP_TEST
HKCU\Software\WPP
HKCU\Software\WPP\WPP_TEST
HKLM\Software\WPP
HKLM\Software\WPP\WPP_TEST

then maybe WPP_TEST writes its options to the registry. To verify this you have to check (with Regedit, or even rerunning WPP_TEST) if subkeys of these values vary by changing the options in WPP_TEST. If this happens, WPP_TEST is not portable.

4b) User Directories
If WPP_TEST writes its options in the following directories (or their subdirectories), or if a directory is "WPP_TEST" or "WPP" or similar, as a subdirectory of the following:

C:\Windows
C:\Documents and Settings\All Users\Application Data
C:\Documents and Settings\USERNAME\Application Data
C:\Documents and Settings \USERNAME\Local Settings\Application Data

(which are usually the ones to be selected in the Regshot options), WPP_TEST is not portable.

Note: Please check very carefully the files specified in the log and verify their contents, as the filenames may not seem related to WPP_TEST and by not doing so you would risk missing some important information.

5 - Customizing Regshot

Modifying suitably the "regshot.ini" file, you can make some useful customizations that will allow the creation of a test environment as practical and efficient as possible.

Here's an example (based on the Paraglider fork):

[Setup]
Flag=3
ExtDir=C:\Windows;C:\Documents and Settings\All Users\Application Data;C:\Documents and Settings\USERNAME\Application Data;C:\Documents and Settings\USERNAME\Local Settings\Application Data
OutDir=c:\
UseLongRegHead=0

[SkipRegKey]
0=ShellNoRoam
1=RecentDocs
2=UserAssist
3=Hardware
4=ControlSet001
5=ControlSet002
6=ControlSet003
7=ControlSet004
8=ControlSet005
9=ControlSet006
10=ControlSet007
11=ControlSet008
12=ControlSet009

[SkipDir]
0=Temp
1=prefetch


As you can see, there are some obvious differences compared to the default configuration that comes with Regshot.
First, the value "ExtDir", which corresponds to what is entered by the user in the "Scan dir1[,dir2;...;nn dir]" and that contains the directories selected to be controlled. Then, you can see two sections: [SkipRegKey] and [SkipDir]. As the names suggest, under these headings you can add any number of values (registry keys or directories) to be ignored (skipped) during the shot and comparison stages. In particular, what is under [SkipRegKey] will be ignored on all keys in the registry and what is under [SkipDir] will be ignored only relative to directories and subdirectories selected in "ExtDir" (the classic example "C:\Windows\Temp"). This will allow you to have a much trimmer file with very significant values (that is, let us not loose our focus in a flood of data that does not contribute to our purposes).
Of course, these lists should consist in a fair compromise between "everything" selected and "too much" ignored and should, therefore, be constructed with care and the effects of each change analysed on a variety of standard cases. The more thorough ones will prepare a set of .ini files (with varying density degrees of [Skip...]), increasingly refining the test to finally find one configuration that best suits the diverse needs of the case.

6 - Conclusion

Regshot is without a doubt a very agile, fast and, at the same time, powerful tool to determine, in a short time, the portability of a program, as well as the necessary changes to X-Launcher to make a portable program that is not so natively. It will always remain a tool to be used criteriously, however: much of the responsibility of the findings is, and always will be, with the one in charge of the analysis. Thus, it will be the experience of the individual with the program that will lead to more accurate and satisfactory results. I hope that happens to each of you after reading this tutorial...

[back to top]
[go to page 1-2-3]



[ Modificato gio 25 giu 2009 - 02:09 ]
Torna ad inizio pagina
ZioZione
gio 25 giu 2009 - 08:32
online

Utente registrato #74
Registrato il: dom 21 gen 2007 - 11:31
Provenienza: Tradate (VA)
Messaggi: 3821
Hi MarsC,
thank you very much for your support!
Your translation of my tutorial seems to be very accurate (the error about the third image is probably due to an incorrect rendering of the e_PLUGINS macro of e107).
Unfortunately, the original one is a little outdated (mainly for the links to the programs... we now deal with X-Regshot 2.0.1.66 -Link- ...). I promise that when I will have some free time I will update it...
Best Regards
ZioZione
Torna ad inizio pagina
nelliemiller
mar 06 lug 2010 - 08:08
online
Utente registrato #39080
Registrato il: mar 06 lug 2010 - 08:04
Messaggi: 1
works perfectly with me. Thanks!
Torna ad inizio pagina

Moderatori: Danix, Taf, Rcs, Energy, zandet2, ZioZione, Admin, LordJim60

Salta:     Torna ad inizio pagina

RSS discussione: rss 0.92 RSS discussione: rss 2.0 RSS discussione: RDF
Powered by e107 Forum System