Compare Versions feature under windows

Permalink 1 user found helpful
I've been playing around with concrete now for a little while and thought I'd post up a solution to the troubles I was having with the compare versions feature, I didn't know exactly where to put it and thought here was as good a place as any.

Since I'm running windows, chmod doesn't work in the same way that it works on Unix + Linux, so I went looking for another solution to the problem.

What I found was py2exe, a program that converted the python script to an executable for the php to use instead.

I used some friendly help from this website to create my solution.http://logix4u.net/Python/Tutorials/How_to_create_Windows_executabl...

What I did was firstly download and install python 2.6, and py2exe, and installed both of these programs.

Then I added the python install directory into my windows system path, as it hadn't done so automatically.

Next I went to the directory I had installed concrete5 to and went into the concrete\libraries\3rdparty directory. In this directory I created a new folder called htmldiff.

this is where I copied my htmldiff.py file into.

Next in this same directory I created a python script called setup.py and edited it using notepad, and put the following text into it.

## - copy from here
from distutils.core import setup
import py2exe
setup(console=['htmldiff.py'])
## - upto here

then I opened up a command window and navigated to the newly created htmldiff directory. eg.
cd d:\www\concrete\libraries\3rdparty\htmldiff

and ran the following command. "python setup.py py2exe" without the quote marks.

this should then convert the .py file to an exe file located in the htmldiff/dist directory.

and the last step was to change the file concrete/config/base.php
to read '/htmldiff/dist/htmldiff.exe' instead of '/htmldiff.py'.

from here its your choice whether you want to uninstall python or py2exe or keep them.

Hope this is of some help to you.

mcgrailka
 
chunksmurray replied on at Permalink Reply
chunksmurray
Thanks for this info! I'd been struggling with this on a windows install a while ago.

Will have to give it a try later.

Cheers!
mcgrailka replied on at Permalink Reply
mcgrailka
Glad I could be of some help, let me know how it goes, it was quite late when I wrote it. so I may have missed something.
nando replied on at Permalink Reply
nando
I've done everything as per your instructions, i.e. successfully created the htmldiff.exe and updated the path in base.php now get this error

Warning: system() [function.system]: Unable to fork [E:\websites\mySite_C5\concrete\config/../libraries/3rdparty/htmldiff/htmldiff.exe E:\websites\mySite_C5/files/tmp/1289193384_1_12.html E:\websites\mySite_C5/files/tmp/1289193384_1_70.html] in E:\websites\mySite_C5\concrete\tools\versions.php on line 65

Where there any other setting that needed to be changed?

Your assistance will be greatly apprecited

Cheers

Nando
mcgrailka replied on at Permalink Reply
mcgrailka
Unfortunately, those are the only changes I had to make to get it to work.

The only thing I can think to suggest is to check the permissions on the tmp folder as that seems to be a common folder being used and ensure your web site user has the right access privileges to it.
mcgrailka replied on at Permalink Reply
mcgrailka
Also, may be of help to you is this article here.

http://www.somacon.com/p255.php...
nando replied on at Permalink Reply
nando
Thanks for your help, I'll check that article and let you know the results

Cheers
nando replied on at Permalink Reply
nando
Hi mcgraika
Yes that fixed the issue. Thank you very much for all your help.
campbell replied on at Permalink Reply
campbell
This was an excellent guide, mcgrailka. Thanks so much.

I'll add one note for anyone using it, though. If you're running Windows 7 64-bit, you may run into problems with your py2exe install. When I was going through this process, I downloaded the basic Python 2.7.2 version and installed it, but it didn't update the registry. When you attempt to install py2exe, it checks the registry for your Python version and doesn't find it, hanging the installation.

I ended up using ActivePython instead, and everything worked beautifully.

http://www.activestate.com/activepython/downloads...

Thanks again!
mcgrailka replied on at Permalink Reply
mcgrailka
Thanks for adding to this, its been a while since I wrote the guide so I'm glad that this was of some use to you still.
I think when I did this I used active python aswell, but never thought it would be important to mention.
Glad the tutorial was of some use anyway, and thanks for adding to it. :)