[Feedback needed] AND2 Checker: Easy installation and update v0.3

Not really. I had almost no time to code lately ! I've tried to adapt my code to linux so i can compile it right from my PC, then i've tried to recompile qt on a virtual machine to get a static installation but i had an error message which is hard to debug.

I'll have no job for two weeks starting friday so i will have full time to do it :) and I already have the code idea in mind.
 
Ok. Last night I set up QtCreator and was able to compile the project successfully myself. I did find a minor bug in the codebase, but I'll submit a patch on github later.
 
So to clarify the bug I found, you are missing a semicolon here: https://github.com/dbkblk/and2_checker/blob/devel/checker/main.cpp#L22

I am on a 64-bit machine, and I assume you are not, otherwise you would have not been able to compile. Also I think your logic for checking if the machine is 64-bit is wrong, if the checker is compiled on a 64-bit machine (as indicated by the _WIN64 macro) that does not mean the user is on a 64-bit machine. You should probably just use:

Code:
BOOL b_64BitOpSys;
IsWow64Process(GetCurrentProcess(), &b_64BitOpSys);

and not bother with the macro at all.

Also I had trouble compiling a releasable build, I could only get Qt Creator to build in debug mode. Could you perhaps document how to build the application, in case I am missing some steps?

Finally, less about the code and more about the updater. I'd like to be able to replace the main download installer with this eventually, but there are a couple key issues preventing that. First, this updater has to be run from the RAND mod directory, which is counter-intuitive. It would be easiest if the updater could be run from anywhere, and found the mod directory on it's own (or asked the user, failing to find it from the registry).
 
So to clarify the bug I found, you are missing a semicolon here: https://github.com/dbkblk/and2_checker/blob/devel/checker/main.cpp#L22
Code:
BOOL b_64BitOpSys;
IsWow64Process(GetCurrentProcess(), &b_64BitOpSys);

I've changed this recently and messed up the code in main.cpp. I wanted to be able to compile it on linux to work on it in my distro then check it into a virtual machine.
I think i will revert my changes and work exclusively in the VM. Thanks for pointing that out !

Also I had trouble compiling a releasable build, I could only get Qt Creator to build in debug mode. Could you perhaps document how to build the application, in case I am missing some steps?

I used QtCreator 5.3.2 with a custom compiled static Qt 5.3 installation (with msvc-2010). You should be able to compile it with the standard dynamic installation as well !


Finally, less about the code and more about the updater. I'd like to be able to replace the main download installer with this eventually, but there are a couple key issues preventing that. First, this updater has to be run from the RAND mod directory, which is counter-intuitive. It would be easiest if the updater could be run from anywhere, and found the mod directory on it's own (or asked the user, failing to find it from the registry).
Note that the installer put the updater into the right folder, so it shouldn't be executed in another folder.
Do you expect it to move into the right folder after the first launch ? How do you think it should behave ?
 
I used QtCreator 5.3.2 with a custom compiled static Qt 5.3 installation (with msvc-2010). You should be able to compile it with the standard dynamic installation as well !

Ah, that is the step I was missing. I had to go look up how to do a static installation from the Qt source code.


Note that the installer put the updater into the right folder, so it shouldn't be executed in another folder.
Do you expect it to move into the right folder after the first launch ? How do you think it should behave ?

I am suggesting that the updater be a completely self-contained executable, without a need for an installer.

Right now when the user downloads the application it has these steps:

1.) Installer runs, installs the updater to the mod location
2.) User runs the updater, it installs the mod
3.) User runs the game through the updater

I'd like to combine step 1 and step 2, so that instead of having to install the updater anywhere, it just runs without any installation. All of the libraries that are currently unpacked could probably just be loaded into memory. So users would just download the updater and it would contain and run everything, no matter where they moved it or what files they changed.
 
Ah, that is the step I was missing. I had to go look up how to do a static installation from the Qt source code.
Here are the steps i use to compile a static installation:
Qt static build:
- Make QtStatic folder
- Install Perl (Strawberry) and Python
- Decompress jom in C:\QtStatic\tools\jom (see qt website)
- Decompress Qt source in C:\QtStatic\qt-x.x.x-src (or use the maintenance tool which download it to C:\Qt\5.3\Src\)
- Install Microsoft SDK 7.1 or Visual C++ 2010 express
- Open MSVC prompt:
- Cd into the build folder
SetEnv.cmd /x86 /Release
set PATH=%PATH%;C:\QtStatic\tools\jom;
set LANG=en
c:\QtStatic\qt-x.x.x-src\configure -release -static -opensource -opengl desktop -nomake examples -nomake tests (-debug-and-release ?) (or C:\Qt\5.3\Src, as the configure option will copy the files into the folder you are into)
jom /W /S -j8 (with 8 the number of your CPU cores).

1.) Installer runs, installs the updater to the mod location
2.) User runs the updater, it installs the mod
3.) User runs the game through the updater

I'd like to combine step 1 and step 2, so that instead of having to install the updater anywhere, it just runs without any installation. All of the libraries that are currently unpacked could probably just be loaded into memory. So users would just download the updater and it would contain and run everything, no matter where they moved it or what files they changed.

In fact, you expect the installer to fully install the mod in one step.
What are the benefits of being able to launch it anywhere ? Actually, the executable does not need any libraries, but svn or rsync does.
I don't know how to create an executable which embed others files ATM :/

The alternative is to automatically launch the checker once the mod is installed ?
 
Here are the steps i use to compile a static installation:
Qt static build:
- Make QtStatic folder
- Install Perl (Strawberry) and Python
- Decompress jom in C:\QtStatic\tools\jom (see qt website)
- Decompress Qt source in C:\QtStatic\qt-x.x.x-src (or use the maintenance tool which download it to C:\Qt\5.3\Src\)
- Install Microsoft SDK 7.1 or Visual C++ 2010 express
- Open MSVC prompt:
- Cd into the build folder
SetEnv.cmd /x86 /Release
set PATH=%PATH%;C:\QtStatic\tools\jom;
set LANG=en
c:\QtStatic\qt-x.x.x-src\configure -release -static -opensource -opengl desktop -nomake examples -nomake tests (-debug-and-release ?) (or C:\Qt\5.3\Src, as the configure option will copy the files into the folder you are into)
jom /W /S -j8 (with 8 the number of your CPU cores).

Thanks!

In fact, you expect the installer to fully install the mod in one step.
What are the benefits of being able to launch it anywhere ? Actually, the executable does not need any libraries, but svn or rsync does.
I don't know how to create an executable which embed others files ATM :/

The alternative is to automatically launch the checker once the mod is installed ?

Hm. I think if the checker launched as soon as the mod was installed, that would be simple enough.
 
@Afforess: Assuming we won't use SVN anymore for updating.

How do you think i can get the changelog ? SVN need to have a .svn to grab changelog so i need to get it with another method.
My best guess is that you enhance your script to automatically:
- Generate a "changelog_last.json" which contains the last 50 entries.
- Generate a "changelog_full.json" which contains all the changelog history.
The ideal move would be to put the revision number in a separate tag so i just need to check it out. These would need to be accessible with rsync.
"repo.json" won't be needed anymore as rsync will handle everything.
(EDIT: No need for JSON, the easiest for you is to output the request of svn changelog with "svn --xml" and i will parse it in no time. So i need a changelog_last.xml and changelog_full.xml).

The idea behind that is to simplify the behavior of the launcher:
- Start and initialise the launcher
- Use rsync the grab changelog_last.json.
- Check the latest version from the file and compare it with the local installation (from the python file ? or maybe from a variable in the ini which is validated if the update went well ?).
- If there is an update, inform the user (with the yellow update button).
- The update window will print the "changelog_last" content. A button will invite the user to read the full if needed. Another one to begin the update.
- Blacklist the config files from the rsync sync operation.
- The addons support will be removed from now.

Then, on a later update:
- Allow the user to exclude custom files from the sync process.
- Download mods, check the contained filepaths and then exclude it from the rsync process. Allow to remove them by "un-blacklisting" them then rsync again.

About the installer:
I think it should be possible to integrate rsync inside the NSIS installer.

What need to be resolved:
I need to find a way to get progress from rsync to properly integrate it into a GUI.

Do you agree about the process ?
 
@Afforess: Assuming we won't use SVN anymore for updating.

How do you think i can get the changelog ? SVN need to have a .svn to grab changelog so i need to get it with another method.
My best guess is that you enhance your script to automatically:
- Generate a "changelog_last.json" which contains the last 50 entries.
- Generate a "changelog_full.json" which contains all the changelog history.
The ideal move would be to put the revision number in a separate tag so i just need to check it out. These would need to be accessible with rsync.
"repo.json" won't be needed anymore as rsync will handle everything.
(EDIT: No need for JSON, the easiest for you is to output the request of svn changelog with "svn --xml" and i will parse it in no time. So i need a changelog_last.xml and changelog_full.xml).

The idea behind that is to simplify the behavior of the launcher:
- Start and initialise the launcher
- Use rsync the grab changelog_last.json.
- Check the latest version from the file and compare it with the local installation (from the python file ? or maybe from a variable in the ini which is validated if the update went well ?).
- If there is an update, inform the user (with the yellow update button).
- The update window will print the "changelog_last" content. A button will invite the user to read the full if needed. Another one to begin the update.
- Blacklist the config files from the rsync sync operation.
- The addons support will be removed from now.

Then, on a later update:
- Allow the user to exclude custom files from the sync process.
- Download mods, check the contained filepaths and then exclude it from the rsync process. Allow to remove them by "un-blacklisting" them then rsync again.

About the installer:
I think it should be possible to integrate rsync inside the NSIS installer.

What need to be resolved:
I need to find a way to get progress from rsync to properly integrate it into a GUI.

Do you agree about the process ?

That all sounds good. I will look into getting a changelog_last.xml and changelog_full.xml ASAP.
 
Thanks :)

EDIT: I don't know how to get these files from rsync ! The rsync module server-side only allow me to access to the ftp, which point straight to the mod folder !
 
Another thought. If you don't want to try and figure out http requests for Windows C++, you could use the wget module that comes with cygwin and make requests that way.
 
That FRICKIN SVN update just wrote over my changes again Dammit!

I had renamed the xml that I wanted to save but forgot some others so now I have a problem, also because I didn't allow the units info .xml to change I now have 8 xml errors upon startup.

So the purpose of this rant is to ask (BEG) you guys to try to find a solution to upgrade to the current SVN without losing my changes.
 
Don't test with the SVN copy? I have the SVN edition and then a separate mod for actually playing the game.
 
Good for you, I do the same.

So how do you update the mod?

My mod is modded to reflect my reality so I cannot just let SVN blindly overwrite the whole thing.
The guys on this thread are trying to write code that will update without overwriting my changes, at least that is what I believe.

So how do you update the mod?
 
Well, if you want to preserve your local copy, you might want to look into WinDiff, so you can see what files are being merged. After all, if you change file X and the SVN does too, you really don't have many other options.
 
I see you have never changed an XML or line of code in a game which is updated by SVN. What SVN does is overwrite the WHOLE game not just the current update code so any changes you have made are rewritten to the current SVN and all your hard work is for naught.

Many players like me will use the simple tools available or simply change an XML to make the mod more relevant to our vision of "game reality". SVN does NOT account for our changes.

That is why I have posted on this thread.
 
Sorry for the delay, i've finished the rsync version but i need some days to test it out as i'm in rush currently.
The new version have the ability to blacklist the files you don't want to update AND it is independant from SVN (it won't duplicate files so the installation would be only 1.7go).

FOR TESTING PURPOSE: You can try the beta installer but it not that useful as, once you will update the game, the beta installer will be replaced by the old one. You'll need to overwrite with this installer again (it won't hurt). If you find some bugs, please tell me :). It sometimes crash on update so i can't release it for now. You can try this to report if the first update works fine for you !
You can try to blacklist by adding filepaths into "checker/exclusions.custom.xml" (open it with a text editor / check exclusions.default.xml for an example). It will totally NOT update the files listed here. I'll try to make a GUI in the near future.
 
Top Bottom