diff-doc.js / diff-docx.js not working with signed documents

208 views
Skip to first unread message

Ignacio G. T.

unread,
Mar 21, 2013, 4:28:41 AM3/21/13
to us...@tortoisesvn.tigris.org, igtorqu...@googlemail.com
I have a Word document (docx format) in the repository, with two digital signatures. As you may know, this makes the Word document read-only.

I checkout the doc, delete the signatures, modify the doc and commit it.

Now I compare the local copy (identical to the last version in the repository) with the previous version in the repository, i.e., the signed version (TortoiseSVN --> Diff with previous version).

The following dialogue appears:

Windows Script Host
--------
Error comparing C:\...\MyDocument.docx and C:\...\AppData\Local\Temp\MyDocument.docx-rev6402.svn000.tmp.docx

The same happens if the document is in doc (2003) format.

However, if the signed document is the most recent version, and I compare it with a previous version (not signed), the comparison works OK.

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3051589

To unsubscribe from this discussion, e-mail: [users-un...@tortoisesvn.tigris.org].

Jared Silva

unread,
Mar 22, 2013, 11:22:36 PM3/22/13
to us...@tortoisesvn.tigris.org, igtorqu...@googlemail.com
Try to diff the two files using Word itself.  The problem could be with Word's algorithm and not the script.  I have found this to be the case in certain circumstances.

Ignacio G. T.

unread,
Mar 23, 2013, 3:33:28 PM3/23/13
to us...@tortoisesvn.tigris.org
Yes, I have noticed that comparing signed documents inside Word works fine: if the first document is signed, Word modifies it before the comparison (I can see it because a temporary file corresponding to that signed document is created). I was looking for a way to do the same from the script... :-(

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3051793

Jared Silva

unread,
Mar 24, 2013, 8:07:38 PM3/24/13
to us...@tortoisesvn.tigris.org
I did some digging around...

Issue 465 (http://code.google.com/p/tortoisesvn/issues/detail?id=465) "Added support for MS Word 2013 - remove file readonly attribute".  The attribute is modified only if Word 2013 is being used, so you can try removing the version check and see what happens.  You might need to do the same for sNewDoc as well.

If that does not work, you might be out of luck:
http://msdn.microsoft.com/en-us/library/office/bb216319%28v=office.12%29.aspx
"ReadOnly
True to open the document as read-only. This argument doesn't override the read-only recommended setting on a saved document. For example, if a document has been saved with read-only recommended turned on, setting the ReadOnly argument to False will not cause the file to be opened as read/write."

This leads me to believe the only way for you to automate this at this point would be to remove the signing, and then compare.  I am not sure if that option is available in the scripting library.

Ignacio G. T.

unread,
Mar 11, 2014, 7:57:23 AM3/11/14
to us...@tortoisesvn.tigris.org
One year has passed since my first post on this subject. Now that I have been forced to upgrade to Office 2013, I have had to download the latest scripts for comparing documents (I'm still using TortoiseSVN 1.6.13).

Everything is working fine... except for this signed documents issue. Now I can confirm what Jared suspected one year ago (thanks, Jared): the only obvious means to automate the comparison is removing somehow the signature of the "second" document.

I wonder if someone more knowledgable than I could point me to the right scripting function to remove a signature from a Word document (if it exists!).

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3074348

Stefan Küng

unread,
Mar 12, 2014, 4:16:36 PM3/12/14
to us...@tortoisesvn.tigris.org
On 11.03.2014 12:57, Ignacio G. T. wrote:
> One year has passed since my first post on this subject. Now that I
> have been forced to upgrade to Office 2013, I have had to download
> the latest scripts for comparing documents (I'm still using
> TortoiseSVN 1.6.13).
>
> Everything is working fine... except for this signed documents issue.
> Now I can confirm what Jared suspected one year ago (thanks, Jared):
> the only obvious means to automate the comparison is removing somehow
> the signature of the "second" document.
>
> I wonder if someone more knowledgable than I could point me to the
> right scripting function to remove a signature from a Word document
> (if it exists!).

Can you compare signed documents in Word manually?
What error do you get when you try to diff those documents with TSVN?
Can you send two different signed documents here to test?

Stefan

--
___
oo // \\ "De Chelonian Mobile"
(_,\/ \_/ \ TortoiseSVN
\ \_/_\_/> The coolest interface to (Sub)version control
/_/ \_\ http://tortoisesvn.net

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3074463
Reply all
Reply to author
Forward
0 new messages