~pythonregexp2.7/python/issue2636-09-01+10

« back to all changes in this revision

Viewing changes to Tools/msi/msilib.py

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-22 21:39:45 UTC
  • mfrom: (39055.1.33 Regexp-2.7)
  • Revision ID: darklord@timehorse.com-20080922213945-23717m5eiqpamcyn
Merged in changes from the Single-Loop Engine branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
289
289
 
290
290
def init_database(name, schema,
291
291
                  ProductName, ProductCode, ProductVersion,
292
 
                  Manufacturer):
 
292
                  Manufacturer,
 
293
                  request_uac = False):
293
294
    try:
294
295
        os.unlink(name)
295
296
    except OSError:
311
312
    si.SetProperty(PID_AUTHOR, Manufacturer)
312
313
    si.SetProperty(PID_TEMPLATE, msi_type)
313
314
    si.SetProperty(PID_REVNUMBER, gen_uuid())
314
 
    si.SetProperty(PID_WORDCOUNT, 2) # long file names, compressed, original media
 
315
    if request_uac:
 
316
        wc = 2 # long file names, compressed, original media
 
317
    else:
 
318
        wc = 2 | 8 # +never invoke UAC
 
319
    si.SetProperty(PID_WORDCOUNT, wc)
315
320
    si.SetProperty(PID_PAGECOUNT, 200)
316
321
    si.SetProperty(PID_APPNAME, "Python MSI Library")
317
322
    # XXX more properties
333
338
    #str = str.replace(".", "_") # colons are allowed
334
339
    str = str.replace(" ", "_")
335
340
    str = str.replace("-", "_")
 
341
    str = str.replace("+", "_")
336
342
    if str[0] in string.digits:
337
343
        str = "_"+str
338
344
    assert re.match("^[A-Za-z_][A-Za-z0-9_.]*$", str), "FILE"+str
477
483
                        [(feature.id, component)])
478
484
 
479
485
    def make_short(self, file):
 
486
        file = re.sub(r'[\?|><:/*"+,;=\[\]]', '_', file) # restrictions on short names
480
487
        parts = file.split(".")
481
488
        if len(parts)>1:
482
489
            suffix = parts[-1].upper()
505
512
                if pos in (10, 100, 1000):
506
513
                    prefix = prefix[:-1]
507
514
        self.short_names.add(file)
508
 
        assert not re.search(r'[\?|><:/*"+,;=\[\]]', file) # restrictions on short names
509
515
        return file
510
516
 
511
517
    def add_file(self, file, src=None, version=None, language=None):