Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
49561ada
Commit
49561ada
authored
Aug 28, 2010
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace cabarc with FCICreate.
parent
9f59fa5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
36 deletions
+4
-36
Tools/msi/msilib.py
Tools/msi/msilib.py
+4
-36
No files found.
Tools/msi/msilib.py
View file @
49561ada
...
...
@@ -5,7 +5,7 @@ import win32com.client.gencache
import
win32com.client
import
pythoncom
,
pywintypes
from
win32com.client
import
constants
import
re
,
string
,
os
,
sets
,
glob
,
subprocess
,
sys
,
_winreg
,
struct
import
re
,
string
,
os
,
sets
,
glob
,
subprocess
,
sys
,
_winreg
,
struct
,
_msi
try
:
basestring
...
...
@@ -350,7 +350,7 @@ def gen_uuid():
class
CAB
:
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
file
=
open
(
name
+
".txt"
,
"wt"
)
self
.
file
s
=
[]
self
.
filenames
=
sets
.
Set
()
self
.
index
=
0
...
...
@@ -369,47 +369,15 @@ class CAB:
if
not
logical
:
logical
=
self
.
gen_id
(
dir
,
file
)
self
.
index
+=
1
if
full
.
find
(
" "
)
!=-
1
:
print
>>
self
.
file
,
'"%s" %s'
%
(
full
,
logical
)
else
:
print
>>
self
.
file
,
'%s %s'
%
(
full
,
logical
)
self
.
files
.
append
((
full
,
logical
))
return
self
.
index
,
logical
def
commit
(
self
,
db
):
self
.
file
.
close
()
try
:
os
.
unlink
(
self
.
name
+
".cab"
)
except
OSError
:
pass
for
k
,
v
in
[(
r"Software\
Mic
rosoft\
Visu
alStudio\7.1\
Se
tup\
VS
", "
VS7CommonBinDir
"),
(r"
Software
\
Microsoft
\
VisualStudio
\
8.0
\
Setup
\
VS
", "
VS7CommonBinDir
"),
(r"
Software
\
Microsoft
\
VisualStudio
\
9.0
\
Setup
\
VS
", "
VS7CommonBinDir
"),
(r"
Software
\
Microsoft
\
Win32SDK
\
Directories
", "
Install
Dir
"),
]:
try:
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k)
dir = _winreg.QueryValueEx(key, v)[0]
_winreg.CloseKey(key)
except (WindowsError, IndexError):
continue
cabarc = os.path.join(dir, r"
Bin
", "
cabarc
.
exe
")
if not os.path.exists(cabarc):
continue
break
else:
print "
WARNING
:
cabarc
.
exe
not
found
in
registry
"
cabarc = "
cabarc
.
exe
"
cmd = r'"
%
s
" -m lzx:21 n %s.cab @%s.txt' % (cabarc, self.name, self.name)
p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in p.stdout:
if line.startswith("
--
adding
"):
sys.stdout.write("
.
")
else:
sys.stdout.write(line)
sys.stdout.flush()
if not os.path.exists(self.name+"
.
cab
"):
raise IOError, "
cabarc
failed
"
_msi
.
FCICreate
(
self
.
name
+
".cab"
,
self
.
files
)
add_data
(
db
,
"Media"
,
[(
1
,
self
.
index
,
None
,
"#"
+
self
.
name
,
None
,
None
)])
add_stream
(
db
,
self
.
name
,
self
.
name
+
".cab"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment