/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/win32/brz_postinstall.py

Merge test-run support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
""" % os.path.basename(sys.argv[0])
50
50
 
51
51
# Windows version
52
 
_major, _minor, _build, _platform, _text = sys.getwindowsversion()
 
52
_major,_minor,_build,_platform,_text = sys.getwindowsversion()
53
53
# from MSDN:
54
54
# dwPlatformId
55
55
#   The operating system platform.
93
93
    hkey_str = {_winreg.HKEY_LOCAL_MACHINE: 'HKEY_LOCAL_MACHINE',
94
94
                _winreg.HKEY_CURRENT_USER: 'HKEY_CURRENT_USER',
95
95
                _winreg.HKEY_CLASSES_ROOT: 'HKEY_CLASSES_ROOT',
96
 
                }
 
96
               }
97
97
 
98
98
    dry_run = False
99
99
    silent = False
115
115
                                    "add-shell-menu",
116
116
                                    "delete-shell-menu",
117
117
                                    "check-mfc71",
118
 
                                    ])
 
118
                                   ])
119
119
 
120
120
        for o, a in opts:
121
121
            if o in ("-h", "--help"):
191
191
        keys = ((_winreg.HKEY_LOCAL_MACHINE, (r'System\CurrentControlSet\Control'
192
192
                                              r'\Session Manager\Environment')),
193
193
                (_winreg.HKEY_CURRENT_USER, r'Environment'),
194
 
                )
 
194
               )
195
195
 
196
196
        hkey = None
197
197
        for key, subkey in keys:
239
239
                    _winreg.SetValueEx(hkey, 'Path', 0, type_, path_u)
240
240
                    _winreg.FlushKey(hkey)
241
241
 
242
 
        if hkey is not None:
 
242
        if not hkey is None:
243
243
            _winreg.CloseKey(hkey)
244
244
 
245
245
    if (add_path or delete_path) and winver == 'Windows 98':
283
283
                            f.write(i)
284
284
            else:
285
285
                print('*** Remove line <%s> from autoexec.bat' % pattern)
286
 
 
 
286
                    
287
287
        elif add_path and not found:
288
288
            backup_autoexec_bat(abat, abak, dry_run)
289
289
            if not dry_run:
305
305
                            'EnvironmentError',
306
306
                            MB_OK | MB_ICONERROR)
307
307
 
308
 
        if hkey is not None:
 
308
        if not hkey is None:
309
309
            _winreg.SetValue(hkey, '', _winreg.REG_SZ, 'Brz Here')
310
310
            hkey2 = _winreg.CreateKey(hkey, 'command')
311
311
            _winreg.SetValue(hkey2, '', _winreg.REG_SZ,
340
340
                         "where Brz installed.\n"
341
341
                         "For detailed instructions see:\n"
342
342
                         "http://wiki.bazaar.canonical.com/BzrOnPureWindows"
343
 
                         ),
 
343
                        ),
344
344
                        "Warning",
345
345
                        MB_OK | MB_ICONEXCLAMATION)
346
346