OSDN Git Service

BuildScript: Find WinMerge root folder before accessing other files or components...
authorKimmo Varis <kimmov@gmail.com>
Wed, 17 Dec 2008 18:39:52 +0000 (18:39 +0000)
committerKimmo Varis <kimmov@gmail.com>
Wed, 17 Dec 2008 18:39:52 +0000 (18:39 +0000)
Tools/Scripts/create_release.py

index de93d06..8893318 100644 (file)
@@ -386,8 +386,13 @@ def create_runtime_folder(runtimes_folder):
     shutil.copy('Installer/Runtimes/msvcr71.dll', runtimes_folder)
 
 def find_winmerge_root():
-    """Find WinMerge tree root folder from where to run rest of the script."""
-    
+    """Find WinMerge tree root folder from where to run rest of the script.
+
+    This function checks if we are in WinMerge root folder. If we are in some
+    other folder then we must try to find the WinMerge root folder. Because all
+    other code assumes we are in WinMerge root folder. If the root folder is
+    found current folder is changed into it."""
+
     # If we find Src and Filters -subfolders we are in root 
     if os.path.exists('Src') and os.path.exists('Filters'):
         return True
@@ -470,10 +475,6 @@ def main(argv):
     if check_tools() == False:
         sys.exit()
 
-    # Check 64-bit ShellExtension is compiled
-    if check_x64shellext() == False:
-        sys.exit()
-
     # Check we are running from correct folder (and go to root if found)
     if find_winmerge_root() == False:
         print 'ERROR: Cannot find WinMerge root folder!'
@@ -482,6 +483,10 @@ def main(argv):
         print 'Tools/Scripts -folder (where this script is located).'
         sys.exit()
 
+    # Check 64-bit ShellExtension is compiled
+    if check_x64shellext() == False:
+        sys.exit()
+
     # Create the distribution folder if it doesn't exist
     try:
         if not os.path.exists(dist_root_folder):