Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

win32: check-in initial __paths__.py for binary installer

Changeset bcb460a0f09a

Parent 102e2001ad09

by Steve Borho

Changes to one file · Browse files at bcb460a0f09a Showing diff from parent 102e2001ad09 Diff from another changeset...

Change 1 of 1 Show Entire File contrib/​win32/​__paths__.py Stacked
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@@ -0,0 +1,25 @@
+""" +__paths__.py + Copyright (C) 2009 Steve Borho <steve@borho.org> + +This software may be used and distributed according to the terms +of the GNU General Public License, incorporated herein by reference. +""" + +# This version of __paths__.py is used in the binary installer +# distributions of TortoiseHg on Windows. Since we no longer need to +# worry about Python shell extensions, we can use the path of the +# current executable to find our package data. + +import win32api, win32process +proc = win32api.GetCurrentProcess() +try: + # This will fail on windows < NT + procpath = win32process.GetModuleFileNameEx(proc, 0) +except: + procpath = win32api.GetModuleFileName(0) + +bin_path = os.path.dirname(procpath) +license_path = os.path.join(bin_path, 'COPYING.txt') +locale_path = os.path.join(bin_path, 'locale') +icon_path = os.path.join(bin_path, 'icons')