def OnAbortButton(self, e):
if not self.running:
self.Close()
return
dlg_title = _(u"Cancel")
dlg_msg = _(u"System update in progress!\n\n Canceling this Progress could result in installation issues.\n"
u"Cancel?")
dlg = wx.MessageDialog(self, dlg_msg, dlg_title, wx.YES_NO|wx.YES_DEFAULT|wx.ICON_EXCLAMATION)
if dlg.ShowModal() == wx.ID_YES:
dlg.Destroy()
if not self.running:
# WPKG Process by this client has finished, no cancel possible
return
print 'Aborting WPKG Process' #TODO: MOVE TO DEBUG LOGGER
self.shouldAbort = True
msg = 'Cancel'
try:
pipeHandle = CreateFile("\\\\.\\pipe\\WPKG", GENERIC_READ | GENERIC_WRITE, 0, None, OPEN_EXISTING, 0, None)
except pywintypes.error, (n, f, e):
print "Error when generating pipe handle: %s" % e #TODO: MOVE TO DEBUG LOGGER
return 1
SetNamedPipeHandleState(pipeHandle, PIPE_READMODE_MESSAGE, None, None)
WriteFile(pipeHandle, msg)
评论列表
文章目录