XYtest-Environment

Discuss and share scripts and script files...
Post Reply
fishgod
Posts: 231
Joined: 03 Feb 2008 00:40
Location: Sankt Augustin (near Bonn), Germany

XYtest-Environment

Post by fishgod »

To check if a strange behavior is a bug or only a crashed config, I build up an environment to check the behavior at clean stage.

1. We need a folder where we want to test in, i'ved choosen C:\DATEN\TEMP\XYtest. (but feel free to use any folder, on the same partition as your normal XY installation)
2. We hardlink our XYplorer.exe from our working-version (e.g. from C:\Programme\XYplorer) to the test-folder. (hardlinking only works within a partition)
3. We create a default ini-file called XYdefault.ini where we put our license-info in, so we don't see the nag-screen :D This file might look like this:

Code: Select all

[Register]
Name=Your Name
Code=xyxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
dc=0
(interesting remark: if you skip the line with "dc=0", XY will fail to start)
4. We use this script: (edit $test_dir to match the path choosen in 1st)

Code: Select all

"resetConf"
  $test_dir = "C:\DATEN\TEMP\XYtest";
  if("<xydata>" != $test_dir) {
    Goto $test_dir;
    if("<curpath>" == $test_dir) {
      Filter "!>(XYplorer\.exe|resetConf\.xys|XYdefault\.ini)";
      Sel 'a';
      Delete 0, 0;
      Filter;
      CopyItem "$test_dir\XYdefault.ini", "$test_dir\XYplorer.ini";
    } else {
      Msg "Failed to switch to XYtest-directory!";
    }
  } else {
    Msg "You don't want to do this in your main XYplorers data-directory!";
  }
  //and if you want to start XY right after the cleanup, feel free to uncomment this:
  //Run "XYplorer.exe"; //we should still be in our test-directory...
You can save this file to "resetConf.xys" in your testing-directory or everwhere else (but not with a different name in the testing-directory).

What the Script does:
1. It preserves that testing-directory is not your config-directory to prevent accidently resetting your config.
2. It ensures that its working in the testing-dir.
3. It deletes all files not having these filenames: XYplorer.exe|resetConf.xys|XYdefault.ini.
4. It copies the XYdefault.ini to XYplorer.ini

Starting a clean copy of your currently using version was never been easier.

I recomment to use this in combination with the great XYplorer Automatic Updater from jacky. So you can ensure the bug is not allready been fixed in the newest version.
Operating System: Win10 x64 / Win11 x64 / almost allways newest XY-beta
totally XYscripting-addicted

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: XYtest-Environment

Post by jacky »

fishgod wrote:I recomment to use this in combination with the great XYplorer Automatic Updater from jacky. So you can ensure the bug is not allready been fixed in the newest version.
Thanks for the nice words :) Although, for the record, you can do this with XYAU already, from the main/script menu click on "Extract a previous version" and it will list all available versions.

Pick one, and it will then (after a confirmation) create in the current folder a new folder "XYplorer X.XX.XXXX" (using the version number you chose, obviously), extract the files in that folder and create a new XYplorer.ini with only you license information. I use it exactly to do what you said: check XY's behavior with a fresh install, and/or track when a change/bug was introduced, etc
Proud XYplorer Fanatic

fishgod
Posts: 231
Joined: 03 Feb 2008 00:40
Location: Sankt Augustin (near Bonn), Germany

Re: XYtest-Environment

Post by fishgod »

I don't know this feature exists, I only use the "CheckForUpdates"-sub, directly called from another mini-script.

Your implementation gives a lot of choices for the user, but it's not a one-click, thats why I like my version more :)
Operating System: Win10 x64 / Win11 x64 / almost allways newest XY-beta
totally XYscripting-addicted

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: XYtest-Environment

Post by jacky »

fishgod wrote:I don't know this feature exists, I only use the "CheckForUpdates"-sub, directly called from another mini-script.

Your implementation gives a lot of choices for the user, but it's not a one-click, thats why I like my version more :)
Sure, to each is own ;) For the record, you could always skip a click or two by calling ExtractOld to have directly the list of different versions you can extract presented to you:

Code: Select all

  load 'XYplorer Automatic Updater', ExtractOld;
And actually, you can even have this little script, to directly (no confirmation!) extract the current version of XY into a new subfolder (XYplorer X.XX.XXXX) :

Code: Select all

  global $XYAU_new_version;
  $XYAU_new_version = <xyver>;
  load 'XYplorer Automatic Updater', _ensureXY;
  load 'XYplorer Automatic Updater', _ensureSettings;
  load 'XYplorer Automatic Updater', _doExtractOld;
Proud XYplorer Fanatic

Post Reply