Changeset 39:9d04ac37db89 for src


Ignore:
Timestamp:
03/08/12 15:41:55 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Running mlxupdate.exe via ShellExecute in Windows, so that the UAC dialog pops up properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/update.py

    r38 r39  
    1212import subprocess
    1313import hashlib
     14
     15if os.name=="nt":
     16    import win32api
    1417
    1518#------------------------------------------------------------------------------
     
    426429        serverSocket.listen(1)
    427430
    428         process = subprocess.Popen([os.path.join(directory, "mlxupdate"),
    429                                     str(port), manifestFile],
    430                                    shell = os.name=="nt")
     431
     432        if os.name=="nt":
     433            win32api.ShellExecute(0, "open", os.path.join(directory, "mlxupdate"),
     434                                  str(port) + " " +  manifestFile, "", 1)
     435        else:
     436            process = subprocess.Popen([os.path.join(directory, "mlxupdate"),
     437                                        str(port), manifestFile],
     438                                       shell = os.name=="nt")
    431439
    432440        (mlxUpdateSocket, _) = serverSocket.accept()
     
    446454        mlxUpdateSocket = None
    447455
    448         process.wait()
     456        if os.name!="nt":
     457            process.wait()
     458       
    449459    except Exception, e:
    450460        print >> sys.stderr, "Failed updating:", str(e)
     
    490500    if fromGUI and not isDirectoryWritable(directory):
    491501        if listener.needSudo():
    492             sudoUpdate(directory, updateURL, listener,
    493                        updateManifest)
     502            sudoUpdate(directory, updateURL, listener, updateManifest)
    494503    else:
    495504        updateFiles(directory, updateURL, listener, updateManifest,
Note: See TracChangeset for help on using the changeset viewer.