#!/opt/thinlinc/libexec/python3
# -*-mode: python; coding: utf-8 -*-
#
# Copyright 2002-2024 Cendio AB.
# For more information, see http://www.cendio.com
# Author: Peter Åstrand <astrand@cendio.se>
if 82 - 82: Iii1i
import os
import sys
import glob
import logging
import _thread
import traceback
import locale
if 87 - 87: Ii % i1i1i1111I . Oo / OooOoo * I1Ii1I1 - I1I
from thinlinc import prefix , sudorelaunch
from thinlinc import tlgtk , wizard
from thinlinc import rpm , deb
from thinlinc . rpmvercmp import rpmVersionCompare
from thinlinc . systemtype import *
from thinlinc . version import TL_VERSION
from thinlinc . vsm . licenseparser import LicenseParser
if 81 - 81: i1 + ooOOO / oOo0O00 * i1iiIII111 * IiIIii11Ii
OOoOoo000O00 = "/var/log/thinlinc-install.log"
Ooo0Ooo = "https://www.cendio.com/thinlinc/docs/platforms"
ii1I1iII1I1I = "https://www.cendio.com/thinlinc/docs/platforms/ubuntu"
if 71 - 71: IIiIIiIi11I1
iI111iiIi11i = "ThinLinc server installer"
if 77 - 77: iIiii1i - ooo0O0oO00 . o00o0OO00O
if 57 - 57: iiIi1 - ii % iiI * IIi1i111IiII . I1I
iIIIII1i111i = iI111iiIi11i
if 8 - 8: i1iiIII111 * i1 . I1I / ii
if 58 - 58: I1Ii1I1 - ooOOO
if 60 - 60: ooo0O0oO00 . ii
i1iiiiIIIiIi = "\nSend a copy of %s to the ThinLinc support.\nVisit https://www.cendio.com/thinlinc/support for information on how to contact us." % OOoOoo000O00
if 22 - 22: IIiIIiIi11I1 . ooo0O0oO00 + iIiii1i + ii
if 85 - 85: OooOoo - oOo0O00 / Ii / ii % i1iiIII111 . Ii
if 7 - 7: iiIi1 - I1Ii1I1 % iiIi1 . I1Ii1I1 . i1i1i1111I
def ii1i11i1 ( text , secondary_text ) :
 if tlgtk . has_gtk :
  if 11 - 11: iiI * iiIi1 % ooOOO + I1I
  if 86 - 86: i1 + IIiIIiIi11I1 + oOo0O00 / i1iiIII111 - Iii1i . ooo0O0oO00
  ii1IiIiiII = None
  for I1I111i11I in tlgtk . Gtk . Window . list_toplevels ( ) :
   if I1I111i11I . get_property ( "visible" ) :
    ii1IiIiiII = I1I111i11I
    if 85 - 85: OooOoo
  o00 = tlgtk . SimpleMessageDialog (
 title = iI111iiIi11i ,
 text = text ,
 transient_for = ii1IiIiiII ,
 modal = True ,
 message_type = tlgtk . Gtk . MessageType . ERROR )
  o00 . format_secondary_markup ( secondary_text )
  o00 . run ( )
  o00 . destroy ( )
 else :
  wizard . text_print_wrapped ( text )
  wizard . text_print_wrapped ( secondary_text )
  if 20 - 20: IIi1i111IiII + i1iiIII111 / I1I
def Ooo0OO ( ) :
 if 6 - 6: i1iiIII111
 if 99 - 99: ooOOO * I1Ii1I1
 if 95 - 95: iIiii1i % Iii1i % i1i1i1111I . OooOoo
 if 70 - 70: IiIIii11Ii
 if 75 - 75: iIiii1i / Ii / IiIIii11Ii + IiIIii11Ii . I1I
 if 88 - 88: Oo * IiIIii11Ii
 for oooOo in [ "LC_ALL" , "LC_CTYPE" , "LANG" ] :
  if oooOo in os . environ :
   I11iIi1i = os . environ [ oooOo ]
   break
 else :
  I11iIi1i = None
  if 49 - 49: o00o0OO00O
  if 29 - 29: IiIIii11Ii - oOo0O00
 for i1IIiII11 in [ "LANGUAGE" , "LANG" , "LC_ALL" , "LC_COLLATE" , "LC_CTYPE" ,
 "LC_MESSAGES" , "LC_MONETARY" , "LC_NUMERIC" , "LC_TIME" ] :
  if i1IIiII11 in os . environ :
   del os . environ [ i1IIiII11 ]
   if 52 - 52: i1iiIII111 % Oo . I1Ii1I1 + ooOOO % Oo . IIi1i111IiII
   if 56 - 56: i1iiIII111 * IIi1i111IiII - iiIi1
 if I11iIi1i is not None :
  os . environ [ "LC_CTYPE" ] = I11iIi1i
  if 15 - 15: I1I % Ii + iIiii1i * Iii1i
  if 67 - 67: I1I * iIiii1i + i1iiIII111 . i1iiIII111 % Oo
  if 93 - 93: oOo0O00 % iIiii1i * i1iiIII111
def OooO0O00o0 ( wzd ) :
 wzd . add_text_handler ( OoOOoO000O )
 wzd . add_gui_handler ( O0o0O0o0o )
 if 37 - 37: IIi1i111IiII * i1i1i1111I + oOo0O00 / I1I / OooOoo
iI1iI = "The currently installed version of ThinLinc is " "too old to be directly upgraded. See the " "platform specific notes on how to upgrade from " "this version:\n\n%s" % ii1I1iII1I1I
if 54 - 54: I1I % IIiIIiIi11I1 * IIiIIiIi11I1 - OooOoo / Iii1i * Oo
if 100 - 100: I1Ii1I1 / iiIi1 * Ii - ii
if 32 - 32: ooo0O0oO00
if 18 - 18: iiIi1 * IIi1i111IiII % ooo0O0oO00 + IIi1i111IiII
def O0OO ( ) :
 if 34 - 34: ooOOO * iiIi1
 if PACKAGE_FORMAT is RPM :
  return False
  if 63 - 63: ooOOO / i1i1i1111I - oOo0O00 * ooOOO / i1iiIII111 + ii
 try :
  if 11 - 11: i1 / IIiIIiIi11I1
  if 89 - 89: I1I * i1i1i1111I
  with open ( '/opt/thinlinc/etc/thinlinc-release' ) as O0OOooO :
   oOOoOOOO000 = O0OOooO . readline ( )
 except OSError :
  if 70 - 70: o00o0OO00O / ooOOO / o00o0OO00O - IIiIIiIi11I1 . i1iiIII111
  if 86 - 86: I1Ii1I1 - OooOoo - ii % IIiIIiIi11I1 . iiI % Iii1i
  return False
  if 11 - 11: OooOoo - I1Ii1I1 - ooOOO . i1iiIII111 - ooo0O0oO00 / i1iiIII111
  if 44 - 44: iIiii1i + i1i1i1111I + Iii1i - ii
 if not oOOoOOOO000 . startswith ( "ThinLinc " ) :
  return False
  if 7 - 7: i1i1i1111I / Ii * Iii1i
  if 32 - 32: IIi1i111IiII . OooOoo
 i1i1iI1II = oOOoOOOO000 . strip ( ) . split ( ) [ - 1 ]
 if rpmVersionCompare ( ( 0 , i1i1iI1II , '1' ) , ( 0 , '4.12.0' , '1' ) ) >= 0 :
  return False
  if 22 - 22: Oo % oOo0O00 / iiI . oOo0O00 . iiI
 return True
 if 87 - 87: I1I - iiI . i1 * Oo
def OoOOoO000O ( ) :
 if not O0OO ( ) :
  return
  if 90 - 90: IIi1i111IiII * iiI . Ii
 wizard . text_print_wrapped ( iI1iI )
 sys . exit ( os . EX_SOFTWARE )
 if 45 - 45: IiIIii11Ii - iiIi1 . i1iiIII111 * iIiii1i . o00o0OO00O
def I1I1iIi ( * args , ** kwargs ) :
 return not O0OO ( )
 if 94 - 94: ooOOO * ii % ooo0O0oO00 - iiI - ooOOO
def O0o0O0o0o ( wizard ) :
 if 42 - 42: ooOOO . ooo0O0oO00
 if PACKAGE_FORMAT is RPM :
  return
  if 32 - 32: IIi1i111IiII % IIiIIiIi11I1 * Iii1i + o00o0OO00O
 ooOOOO00O = wizard . add_page ( "Old version" )
 if 72 - 72: iiIi1
 i1II1 = tlgtk . wizard . centered_label ( tlgtk . linkify_text ( iI1iI ) )
 i1II1 . show_all ( )
 ooOOOO00O . add ( i1II1 )
 if 98 - 98: o00o0OO00O * o00o0OO00O
 ooOOOO00O . connect ( "page-unwilling" , I1I1iIi )
 ooOOOO00O . set_property ( "page-forwardable" , False )
 if 58 - 58: i1i1i1111I
 if 38 - 38: i1 - oOo0O00
 if 85 - 85: o00o0OO00O + iiIi1 % iIiii1i + ii * i1iiIII111
OOOoo0 = "/opt/thinlinc/etc/licenses"
I11 = "Licenses warning"
i1II1oOoOo = "the documentation."
o0oOoo0O0o0Oo = "Proceed without valid ThinLinc %s licenses" % TL_VERSION
if 2 - 2: o00o0OO00O + ooo0O0oO00 - I1Ii1I1 + ooOOO . o00o0OO00O
def iIi111ii ( ) :
 return """The installer did not find any valid licenses for ThinLinc %s (the version currently being installed).

ThinLinc will still run, but without valid %s licenses the number of allowed concurrent users will be restricted.

If unsure, you may safely abort the installation, update your license files, and restart the installation later.

Note:
•  Valid licenses may be added after installing ThinLinc
•  Invalid licenses may remain alongside valid licenses
•  ThinLinc licenses are backwards compatible

For more information on ThinLinc license handling, visit https://www.cendio.com/resources/docs/tag/licensehandling.html""" % ( TL_VERSION , TL_VERSION )
 if 20 - 20: i1i1i1111I + Oo / iIiii1i % IIi1i111IiII % IIi1i111IiII
 if 29 - 29: ooo0O0oO00 - oOo0O00 - iIiii1i % iiI + IIi1i111IiII
def i1iI1 ( ) :
 ii1ii = LicenseParser ( TL_VERSION , logging , OOOoo0 )
 ii1ii . update_licenses ( )
 I11IIiiI1 = ii1ii . get_license_details ( )
 if 37 - 37: i1i1i1111I - i1 * iiI + I1I * Oo - ii
 iiiiiI = I11IIiiI1 == [ ]
 OO0 = any ( [ detail [ 'valid' ] for detail in I11IIiiI1 ] )
 if 39 - 39: ooOOO - ii % ooo0O0oO00 - IIi1i111IiII . iIiii1i . i1iiIII111
 if iiiiiI :
  if 78 - 78: i1i1i1111I . iiI / iiI
  return False
  if 3 - 3: iiI + I1Ii1I1 . iiIi1 - ooo0O0oO00 * I1Ii1I1 + iiI
 if OO0 :
  if 56 - 56: i1i1i1111I - IiIIii11Ii - i1iiIII111 - Oo + i1iiIII111 / iIiii1i
  return False
  if 89 - 89: IIiIIiIi11I1 + Ii % i1i1i1111I - i1iiIII111
 return True
 if 33 - 33: IIiIIiIi11I1 . Iii1i % ii
def OoOOooO0oOO0Oo ( * args , ** kwargs ) :
 return not i1iI1 ( )
 if 4 - 4: i1 % I1Ii1I1 * ii + ii . i1i1i1111I - i1
def I1i ( wzd ) :
 wzd . add_text_handler ( O0OOOOoO0o )
 wzd . add_gui_handler ( o00ooOOO0Oo )
 if 37 - 37: iiI + o00o0OO00O % ooo0O0oO00 / o00o0OO00O % i1iiIII111 + ii
def O0OOOOoO0o ( ) :
 if not i1iI1 ( ) :
  return
  if 98 - 98: ooo0O0oO00 - I1I + i1 * IIiIIiIi11I1 % i1
 wizard . text_print_wrapped ( iIi111ii ( ) )
 print ( )
 o0O0OO0 = wizard . text_prompt ( o0oOoo0O0o0Oo , [ "yes" , "no" ] , "no" )
 if o0O0OO0 not in "yes" :
  Iioo0Oo0oO0 ( )
 print ( )
 if 20 - 20: o00o0OO00O
def O0O0oO00OO0 ( widget , page ) :
 page . set_page_forwardable ( widget . get_active ( ) )
 if 92 - 92: Ii % i1i1i1111I % oOo0O00 / i1
def o00ooOOO0Oo ( wizard ) :
 ooOOOO00O = wizard . add_page ( "Licenses" )
 ooOOOO00O . connect ( "page-unwilling" , OoOOooO0oOO0Oo )
 if 96 - 96: iIiii1i
 ii1IiiIiI , Ooo0O00o = tlgtk . wizard . centered_view ( spacing = 12 )
 if 22 - 22: IIi1i111IiII . IIiIIiIi11I1
 IiiI1III1iI = tlgtk . linkify_text ( iIi111ii ( ) ,
 [ i1II1oOoOo ] )
 if 37 - 37: I1Ii1I1 % ooo0O0oO00 . iiI + iIiii1i + ooOOO * ooo0O0oO00
 if 39 - 39: o00o0OO00O - Oo
 ooOOOO00O . set_page_forwardable ( False )
 II1I1Ii1IIi , Ii1Ii1 = tlgtk . factory . check_list (
 [ o0oOoo0O0o0Oo ] ,
 title = I11 ,
 subtitle = IiiI1III1iI ,
 )
 Ii1Ii1 [ 0 ] . connect ( "toggled" , O0O0oO00OO0 , ooOOOO00O )
 Ooo0O00o . pack_start ( II1I1Ii1IIi , expand = False , fill = False , padding = 0 )
 if 25 - 25: OooOoo + Oo * Ii * ooo0O0oO00 + Ii
 ooOOOO00O . add ( ii1IiiIiI )
 ooOOOO00O . show_all ( )
 if 75 - 75: OooOoo * oOo0O00 . i1iiIII111
 if 96 - 96: I1I / ii / iiIi1 + iiIi1
 if 35 - 35: o00o0OO00O + oOo0O00
oooo000O0 = None
if 47 - 47: IIiIIiIi11I1
def IiII111I1I ( wzd ) :
 wzd . add_text_handler ( ooOo00O0o0o0 )
 wzd . add_gui_handler ( OOooooOOooo0 )
 if 18 - 18: IiIIii11Ii - ii * iiI - OooOoo
def o0OOo0OoO ( s ) :
 if 57 - 57: Oo + IiIIii11Ii
 if 70 - 70: Ii + ooOOO - Oo / i1i1i1111I - I1I * IIi1i111IiII
 iii1ii1 = prefix . get_tl_prefix ( ) + "/../packages"
 iii1ii1 = os . path . normpath ( iii1ii1 )
 if 27 - 27: i1 / OooOoo + Iii1i % OooOoo + OooOoo
 o0o = glob . glob ( os . path . join ( iii1ii1 , s ) )
 o0o = filter ( os . path . isfile , o0o )
 if not o0o :
  logging . error ( "The ThinLinc source directory is not complete. The file %s is missing." % s )
  return [ None ]
  if 17 - 17: IiIIii11Ii
 return o0o
 if 31 - 31: Iii1i + ooOOO / OooOoo . iIiii1i * iiIi1
def iII11iI1i ( ) :
 if PACKAGE_FORMAT is RPM :
  if CPU_ARCH is X86_64 :
   I1iiIII1i = "x86_64"
   if 63 - 63: i1i1i1111I - i1iiIII111 . OooOoo % OooOoo . IIi1i111IiII + iiI
   if 71 - 71: IIiIIiIi11I1 + iiIi1 % ooo0O0oO00 + IIi1i111IiII % Oo - Oo
  IiIIIII1i = "thinlinc-server-[0-9]*-*.%s.rpm" % I1iiIII1i
 elif PACKAGE_FORMAT is DEB :
  if CPU_ARCH is X86_64 :
   I1iiIII1i = "amd64"
  IiIIIII1i = "thinlinc-server_*-*_%s.deb" % I1iiIII1i
 else :
  return None
  if 41 - 41: ooOOO + OooOoo + o00o0OO00O * i1i1i1111I
 iIi = [ ]
 if 96 - 96: OooOoo + Ii % ii % i1iiIII111 % Oo * iIiii1i
 iIi . extend ( o0OOo0OoO ( IiIIIII1i ) )
 if 46 - 46: Ii - IIi1i111IiII + IiIIii11Ii + iiI . I1I % OooOoo
 if 85 - 85: Oo / ii + Oo + ooOOO
 if None in iIi :
  return None
  if 74 - 74: ii - IIi1i111IiII
 return iIi
 if 79 - 79: ii * IIi1i111IiII . ooOOO * I1Ii1I1 . oOo0O00 + i1iiIII111
def oo00 ( ) :
 o00o = iII11iI1i ( )
 if o00o is None :
  return None
  if 12 - 12: I1I % iIiii1i - i1iiIII111 - IiIIii11Ii / i1iiIII111 + iiI
 if PACKAGE_FORMAT is RPM :
  ii1i = rpm . determine_upgrade ( o00o )
 elif PACKAGE_FORMAT is DEB :
  ii1i = deb . determine_upgrade ( o00o )
 else :
  ii1i = None
  if 87 - 87: ooOOO
 if ii1i is not None :
  if len ( ii1i [ "remove" ] ) > 0 :
   logging . info ( "Packages to remove: %s" % ", " . join ( ii1i [ "remove" ] ) )
  if len ( ii1i [ "install" ] ) > 0 :
   logging . info ( "Packages to install: %s" % ", " . join ( map ( os . path . basename , ii1i [ "install" ] ) ) )
  if len ( ii1i [ "upgrade" ] ) > 0 :
   logging . info ( "Packages to upgrade: %s" % ", " . join ( map ( os . path . basename , ii1i [ "upgrade" ] ) ) )
  if len ( ii1i [ "ignore" ] ) > 0 :
   logging . info ( "Packages to ignore: %s" % ", " . join ( map ( os . path . basename , ii1i [ "ignore" ] ) ) )
  if len ( ii1i [ "obsolete" ] ) > 0 :
   logging . info ( "Obsolete packages: %s" % ", " . join ( ii1i [ "obsolete" ] ) )
   if 57 - 57: o00o0OO00O - ooo0O0oO00 % ooOOO - iiIi1 / IiIIii11Ii . iIiii1i
   if 15 - 15: iiI * iiIi1 - oOo0O00
   if 6 - 6: IIi1i111IiII - Ii
   if 1 - 1: I1I + OooOoo
   if 98 - 98: i1iiIII111 + Iii1i . o00o0OO00O
   if 96 - 96: OooOoo / ii - i1 * iiIi1
 if ( PACKAGE_FORMAT is RPM ) and ( 'thinlinc-rdesktop' in ii1i [ "obsolete" ] ) :
  if 72 - 72: i1i1i1111I + Ii - Iii1i - i1i1i1111I - iiI + iIiii1i
  ii1i [ "remove" ] += ii1i [ "obsolete" ]
  ii1i [ "obsolete" ] = [ ]
  if 74 - 74: iIiii1i * Oo + Iii1i - i1iiIII111
 return ii1i
 if 22 - 22: IiIIii11Ii - iIiii1i . i1 . iiI - IIiIIiIi11I1
I1IiIi = "Determining packages to install..."
if 10 - 10: Oo * iiIi1 % IiIIii11Ii / OooOoo + i1
iii1i1 = "There was an error determining which packages to install."
iII11I11111I = "This system already has an up to date installation of ThinLinc."
if 81 - 81: ooo0O0oO00 / o00o0OO00O . ooo0O0oO00
OoO0oOOOooO = "The following packages will be removed:"
oo000OO000oO = "The following packages will be installed:"
II1iiIiI1i1 = "The following packages will be upgraded:"
if 83 - 83: i1 . ooo0O0oO00
def ooOo00O0o0o0 ( ) :
 global oooo000O0
 if 57 - 57: IIi1i111IiII % IiIIii11Ii / oOo0O00 + iIiii1i - i1iiIII111
 print ( I1IiIi , end = ' ' )
 sys . stdout . flush ( )
 if 87 - 87: i1iiIII111 . i1iiIII111 . ii . IIiIIiIi11I1 * oOo0O00
 ii1i = oo00 ( )
 print ( "done." )
 print ( )
 if 33 - 33: IIi1i111IiII * i1iiIII111 / iiI . OooOoo * oOo0O00 + IIiIIiIi11I1
 if ii1i is None :
  wizard . text_print_wrapped ( iii1i1 )
  wizard . text_print_wrapped ( i1iiiiIIIiIi )
  sys . exit ( os . EX_SOFTWARE )
  if 17 - 17: i1i1i1111I * ii + i1iiIII111 - iiIi1 / i1i1i1111I
  if 83 - 83: iiIi1 - Iii1i + oOo0O00 + I1I / o00o0OO00O + I1I
 for type in ( "remove" , "install" , "upgrade" ) :
  if len ( ii1i [ type ] ) > 0 :
   break
 else :
  wizard . text_print_wrapped ( iII11I11111I )
  print ( )
  return
  if 29 - 29: i1i1i1111I / oOo0O00
 oooo000O0 = ii1i
 if 13 - 13: iiIi1 % i1iiIII111 . OooOoo % IIiIIiIi11I1 % OooOoo
 if len ( ii1i [ "remove" ] + ii1i [ "obsolete" ] ) > 0 :
  wizard . text_print_wrapped ( OoO0oOOOooO )
  print ( )
  if 21 - 21: IIi1i111IiII * I1Ii1I1
  for oO00oO0O in ii1i [ "remove" ] + ii1i [ "obsolete" ] :
   print ( "\t" , oO00oO0O )
  print ( )
  if 97 - 97: i1 - i1 % o00o0OO00O + IiIIii11Ii / iiI * ooo0O0oO00
 if len ( ii1i [ "install" ] ) > 0 :
  wizard . text_print_wrapped ( oo000OO000oO )
  print ( )
  if 60 - 60: iiIi1 - iIiii1i % I1Ii1I1
  for oO00oO0O in map ( os . path . basename , ii1i [ "install" ] ) :
   print ( "\t" , oO00oO0O )
  print ( )
  if 26 - 26: ooOOO / o00o0OO00O . ii + iiIi1 . Oo
 if len ( ii1i [ "upgrade" ] ) > 0 :
  wizard . text_print_wrapped ( II1iiIiI1i1 )
  print ( )
  if 37 - 37: I1Ii1I1
  for oO00oO0O in map ( os . path . basename , ii1i [ "upgrade" ] ) :
   print ( "\t" , oO00oO0O )
  print ( )
  if 35 - 35: OooOoo % i1i1i1111I - ooo0O0oO00 / IiIIii11Ii
 wizard . text_wait_prompt ( )
 print ( )
 if 4 - 4: IIiIIiIi11I1 . IiIIii11Ii % IIiIIiIi11I1 / i1i1i1111I
def oO ( page , notebook , package_vbox , actions ) :
 global oooo000O0
 if 13 - 13: i1iiIII111 * OooOoo / oOo0O00 . OooOoo - o00o0OO00O * ooo0O0oO00
 if 79 - 79: i1i1i1111I
 for Ii111 in ( "remove" , "install" , "upgrade" ) :
  if len ( actions [ Ii111 ] ) > 0 :
   break
 else :
  notebook . set_current_page ( 3 )
  page . set_page_busy ( False )
  return
  if 68 - 68: oOo0O00 . oOo0O00 / Ii . i1
 notebook . set_current_page ( 1 )
 page . set_page_busy ( False )
 if 54 - 54: ooo0O0oO00 % Oo . IIi1i111IiII - Iii1i % iiIi1 * iiI
 oooo000O0 = actions
 if 31 - 31: oOo0O00 / Iii1i - IiIIii11Ii % iiI / I1Ii1I1 - i1i1i1111I
 package_vbox . foreach ( package_vbox . remove )
 if 68 - 68: iiIi1 . iiIi1 % iiIi1
 if len ( actions [ "remove" ] + actions [ "obsolete" ] ) > 0 :
  Ii1III1iI = tlgtk . factory . boxed_label_list (
 actions [ "remove" ] + actions [ "obsolete" ] ,
 title = OoO0oOOOooO
 )
  package_vbox . pack_start ( Ii1III1iI , expand = False , fill = False , padding = 0 )
  if 9 - 9: Oo / i1iiIII111 % OooOoo
 if len ( actions [ "install" ] ) > 0 :
  Ii1III1iI = tlgtk . factory . boxed_label_list (
 list ( map ( os . path . basename , actions [ "install" ] ) ) ,
 title = oo000OO000oO
 )
  package_vbox . pack_start ( Ii1III1iI , expand = False , fill = False , padding = 0 )
  if 6 - 6: i1iiIII111 % I1Ii1I1 * ooo0O0oO00
 if len ( actions [ "upgrade" ] ) > 0 :
  Ii1III1iI = tlgtk . factory . boxed_label_list (
 list ( map ( os . path . basename , actions [ "upgrade" ] ) ) ,
 title = II1iiIiI1i1
 )
  package_vbox . pack_start ( Ii1III1iI , expand = False , fill = False , padding = 0 )
  if 90 - 90: I1Ii1I1 * i1i1i1111I / ooo0O0oO00 * Ii
 package_vbox . show_all ( )
 if 38 - 38: I1I . Ii
def OO0OOo0oOO ( page , notebook ) :
 notebook . set_current_page ( 2 )
 page . set_page_busy ( False )
 page . set_page_forwardable ( False )
 if 100 - 100: i1iiIII111
def oOO0OOO ( page , notebook , package_vbox ) :
 ii1i = oo00 ( )
 if 24 - 24: o00o0OO00O * iiIi1 + i1i1i1111I + iIiii1i
 if ii1i is None :
  tlgtk . GLib . idle_add ( OO0OOo0oOO ,
 page , notebook )
  return
  if 11 - 11: I1Ii1I1 % oOo0O00 % Oo + i1i1i1111I
 tlgtk . GLib . idle_add ( oO ,
 page , notebook , package_vbox , ii1i )
 if 42 - 42: oOo0O00 + IIi1i111IiII - iIiii1i * ooo0O0oO00 / ooo0O0oO00 + Ii
def O0oo00 ( page , wizard , first , notebook , package_vbox ) :
 if not first :
  return
  if 52 - 52: I1Ii1I1 % OooOoo . IIi1i111IiII
 notebook . set_current_page ( 0 )
 page . set_page_busy ( True )
 if 87 - 87: OooOoo . i1 . IiIIii11Ii * IiIIii11Ii
 _thread . start_new_thread ( oOO0OOO , ( page , notebook , package_vbox ) )
 if 50 - 50: IIi1i111IiII . ooo0O0oO00 / IiIIii11Ii + i1i1i1111I - iiI
def OOooooOOooo0 ( wizard ) :
 ooOOOO00O = wizard . add_page ( "Packages" )
 if 18 - 18: IIiIIiIi11I1 + ooOOO + Oo / I1Ii1I1 . o00o0OO00O
 oO0Oo0 = tlgtk . Gtk . Notebook ( )
 oO0Oo0 . set_show_tabs ( False )
 oO0Oo0 . set_show_border ( False )
 ooOOOO00O . add ( oO0Oo0 )
 if 37 - 37: I1I - OooOoo . ooo0O0oO00 . ooo0O0oO00 / i1iiIII111 . IiIIii11Ii
 if 91 - 91: ii
 O000 = tlgtk . factory . spinner_text ( I1IiIi )
 oO0Oo0 . append_page ( O000 )
 if 82 - 82: iiIi1 + i1
 if 16 - 16: i1 / o00o0OO00O
 if 4 - 4: iiI % ooo0O0oO00 + ii
 ii1IiiIiI , iII = tlgtk . wizard . centered_view ( scrollable = True )
 oO0Oo0 . append_page ( ii1IiiIiI )
 if 92 - 92: iiIi1 - iIiii1i - i1i1i1111I % i1iiIII111 / i1i1i1111I * ooo0O0oO00
 if 60 - 60: IiIIii11Ii % ii / iiI * OooOoo / iiIi1 - Ii
 if 16 - 16: oOo0O00 / I1Ii1I1 / i1 + iiIi1 + oOo0O00
 oO0Oo0 . append_page ( tlgtk . wizard . centered_label (
 "%s\n%s" % ( iii1i1 , i1iiiiIIIiIi ) ,
 ) )
 if 11 - 11: ii / OooOoo + oOo0O00
 if 79 - 79: iiIi1 . I1Ii1I1 * iiI % I1Ii1I1 / IIi1i111IiII
 if 93 - 93: iiI + Iii1i . Ii . iiI * ooOOO
 oO0Oo0 . append_page ( tlgtk . wizard . centered_label ( iII11I11111I ) )
 if 84 - 84: iIiii1i % IIi1i111IiII
 if 82 - 82: o00o0OO00O
 if 81 - 81: oOo0O00 + i1 - IIiIIiIi11I1 * ooo0O0oO00 + i1i1i1111I
 oO0Oo0 . show_all ( )
 if 89 - 89: I1Ii1I1
 ooOOOO00O . connect ( "page-show" , O0oo00 , oO0Oo0 , iII )
 if 57 - 57: ooo0O0oO00 - i1iiIII111 / OooOoo % i1iiIII111
 if 92 - 92: IiIIii11Ii * OooOoo - IiIIii11Ii
 if 66 - 66: i1iiIII111 . ooo0O0oO00 / ooOOO . i1 - OooOoo
def iI1Iii ( wzd ) :
 wzd . add_text_handler ( OoO0O )
 wzd . add_gui_handler ( OooO0Ooo0 )
 if 46 - 46: Ii
O00OO0ooOoO = "Performing package installation..."
if 94 - 94: IiIIii11Ii - IIiIIiIi11I1 . Ii
IIiI1I1I11 = "There was an error installing the packages."
iIIOo00 = "All packages were installed successfully."
if 52 - 52: Ii . OooOoo . i1iiIII111 * iiIi1 - ooo0O0oO00
def i1IiI11 ( progress_cb ) :
 if 39 - 39: iiIi1 + ii % iiI - o00o0OO00O + Iii1i
 if 48 - 48: Oo * iiI - oOo0O00
 I111i1 = os . getcwd ( )
 os . chdir ( "/tmp" )
 if 7 - 7: I1Ii1I1 - IIi1i111IiII % OooOoo - i1 * Ii
 if PACKAGE_FORMAT is RPM :
  iI = rpm . perform_upgrade ( oooo000O0 , progress_cb )
 elif PACKAGE_FORMAT is DEB :
  iI = deb . perform_upgrade ( oooo000O0 , progress_cb )
 else :
  iI = False
  if 41 - 41: iIiii1i / I1I * iiIi1 - IIi1i111IiII
 os . chdir ( I111i1 )
 if 61 - 61: Ii * OooOoo * I1I % i1iiIII111 % o00o0OO00O * iiIi1
 return iI
 if 49 - 49: ooo0O0oO00 / i1iiIII111 % ii
def OOooO0OoOO0 ( percent ) :
 print ( "\r%s%d%%" % ( O00OO0ooOoO , percent ) , end = ' ' )
 sys . stdout . flush ( )
 if 27 - 27: o00o0OO00O * o00o0OO00O + ii + ooOOO * Oo + iiI
def OoO0O ( ) :
 if not OoOoO0o ( ) :
  return
  if 45 - 45: ooOOO * o00o0OO00O * I1I / ii
 print ( O00OO0ooOoO , end = ' ' )
 sys . stdout . flush ( )
 if 35 - 35: ooOOO * Oo / iiI % i1 / Ii
 iI = i1IiI11 ( OOooO0OoOO0 )
 if 86 - 86: i1 / Oo . i1iiIII111 - o00o0OO00O * Oo
 print ( "\r%s done." % O00OO0ooOoO )
 print ( )
 if 88 - 88: ii . I1Ii1I1
 if not iI :
  wizard . text_print_wrapped ( IIiI1I1I11 )
  wizard . text_print_wrapped ( i1iiiiIIIiIi )
  sys . exit ( os . EX_SOFTWARE )
  if 53 - 53: o00o0OO00O - I1I * i1iiIII111 + Ii + iiI . i1
 wizard . text_print_wrapped ( iIIOo00 )
 print ( )
 if 69 - 69: Ii * iIiii1i / Ii / o00o0OO00O - oOo0O00 / Ii
 wizard . text_wait_prompt ( )
 print ( )
 if 2 - 2: IIi1i111IiII % i1iiIII111 . oOo0O00
def O0OOii1I1I1 ( progress , percent ) :
 tlgtk . GLib . idle_add ( progress . set_fraction ,
 float ( percent ) / 100.0 )
 if 24 - 24: i1iiIII111
def o00O ( page , text , progress ) :
 page . set_page_busy ( False )
 page . set_page_backable ( False )
 if 55 - 55: i1i1i1111I + Oo - OooOoo / i1iiIII111 - i1
 text . set_text ( iIIOo00 )
 progress . set_fraction ( 1.0 )
 if 1 - 1: i1 - ooOOO - i1iiIII111
def o0O0oo ( page , text , progress ) :
 page . set_page_busy ( False )
 page . set_page_backable ( False )
 page . set_page_forwardable ( False )
 if 86 - 86: ooo0O0oO00
 text . set_markup ( "%s\n%s" % ( IIiI1I1I11 , i1iiiiIIIiIi ) )
 progress . hide ( )
 if 40 - 40: iiIi1 - oOo0O00
def I1iiiIi ( page , text , progress ) :
 O00O00oo = lambda I1Ii1ii11i : O0OOii1I1I1 ( progress , I1Ii1ii11i )
 iI = i1IiI11 ( O00O00oo )
 if 74 - 74: I1Ii1I1 / iiIi1 + Oo - I1I * iiI
 if not iI :
  tlgtk . GLib . idle_add ( o0O0oo ,
 page , text , progress )
  return
 tlgtk . GLib . idle_add ( o00O ,
 page , text , progress )
 if 63 - 63: iiIi1
def oo0OO0o0O ( page , wizard , first , text , progress ) :
 if not first :
  return
  if 87 - 87: Iii1i * ooOOO - Iii1i
 page . set_page_busy ( True )
 if 96 - 96: i1i1i1111I % Ii
 _thread . start_new_thread ( I1iiiIi , ( page , text , progress ) )
 if 55 - 55: i1i1i1111I * Ii % i1i1i1111I
def OoOoO0o ( ) :
 if oooo000O0 and any ( oooo000O0 . get ( pt , [ ] ) for pt in ( "remove" , "install" , "upgrade" ) ) :
  if 61 - 61: oOo0O00
  return True
 return False
 if 53 - 53: iIiii1i / IiIIii11Ii
def OOo000o0 ( * args , ** kwargs ) :
 return not OoOoO0o ( )
 if 45 - 45: I1Ii1I1
def OooO0Ooo0 ( wizard ) :
 ooOOOO00O = wizard . add_page ( "Installing" )
 ooOOOO00O . connect ( 'page-unwilling' , OOo000o0 )
 if 69 - 69: OooOoo % i1 * Iii1i . oOo0O00
 ii1IiiIiI , OOooOOoOo0 = tlgtk . wizard . centered_view ( spacing = 6 )
 ii1IiiIiI . set_valign ( tlgtk . Gtk . Align . CENTER )
 ooOOOO00O . add ( ii1IiiIiI )
 if 98 - 98: Ii
 oooo0 = tlgtk . Label ( label = O00OO0ooOoO ,
 max_width_chars = 0 ,
 wrap = True ,
 xalign = 0.5 ,
 justify = tlgtk . Gtk . Justification . CENTER ,
 halign = tlgtk . Gtk . Align . FILL ,
 valign = tlgtk . Gtk . Align . CENTER )
 OOooOOoOo0 . pack_start ( oooo0 , expand = False , fill = True , padding = 0 )
 if 5 - 5: Ii % Ii / ooo0O0oO00 - i1
 i1Ii = tlgtk . Gtk . ProgressBar ( valign = tlgtk . Gtk . Align . CENTER )
 OOooOOoOo0 . pack_start ( i1Ii , expand = False , fill = False , padding = 0 )
 if 94 - 94: iiI + i1iiIII111 % oOo0O00 / iiIi1 / i1
 ii1IiiIiI . show_all ( )
 if 53 - 53: Ii + iiI % I1Ii1I1
 ooOOOO00O . connect ( "page-show" , oo0OO0o0O , oooo0 , i1Ii )
 if 81 - 81: ii - Ii - IIiIIiIi11I1 + i1iiIII111 % iIiii1i * iIiii1i
 if 20 - 20: I1Ii1I1 - o00o0OO00O % i1
 if 29 - 29: OooOoo * Ii - ii
O0oOoOoO0o = None
if 58 - 58: ii . I1I * Ii
def O00ooo0000oO ( wzd ) :
 wzd . add_text_handler ( Iiii1i )
 wzd . add_gui_handler ( o00oOo0OOOO00 )
 if 46 - 46: IiIIii11Ii + o00o0OO00O % ooo0O0oO00
 if 13 - 13: i1iiIII111 - IiIIii11Ii / iIiii1i + iiI . OooOoo / Iii1i
OooOoO = "Installation of ThinLinc completed"
I11III111I = "ThinLinc installer finished"
oOoo00Oo00o0o = "No package changes were required."
iIi1i = "Before using ThinLinc, you must configure it using /opt/thinlinc/sbin/tl-setup."
iIIi1111I1 = "Run ThinLinc setup now"
if 63 - 63: Iii1i
def Iiii1i ( ) :
 global O0oOoOoO0o
 if 69 - 69: Iii1i - iiIi1 . ooOOO * oOo0O00 % Iii1i
 if OoOoO0o ( ) :
  wizard . text_print_wrapped ( '%s!' % OooOoO )
  print ( )
 else :
  wizard . text_print_wrapped ( '%s!' % I11III111I )
  print ( )
  wizard . text_print_wrapped ( oOoo00Oo00o0o )
  print ( )
  if 65 - 65: iIiii1i * Oo / iiIi1 . i1 / IIi1i111IiII / iiIi1
 wizard . text_print_wrapped ( iIi1i )
 print ( )
 if 33 - 33: IIiIIiIi11I1 + IiIIii11Ii . IIiIIiIi11I1
 o0O0OO0 = wizard . text_prompt ( iIIi1111I1 , [ "yes" , "no" ] , "yes" )
 print ( )
 if 59 - 59: i1 / i1i1i1111I + Ii * IIiIIiIi11I1 . IIiIIiIi11I1
 O0oOoOoO0o = o0O0OO0 == "yes"
 if 49 - 49: Ii - Iii1i * I1Ii1I1 * o00o0OO00O . iIiii1i
def oooo00OOoo ( page , wizard , first , text ) :
 global O0oOoOoO0o
 if 88 - 88: iiI % Ii * I1Ii1I1
 if not first :
  return
  if 41 - 41: I1I
 if not OoOoO0o ( ) :
  wizard . set_finish_title ( I11III111I )
  wizard . set_finish_text ( oOoo00Oo00o0o )
  if 76 - 76: IIiIIiIi11I1 * i1i1i1111I
 text . set_text ( tlgtk . sanitise_wrap ( iIi1i ) )
 O0oOoOoO0o = True
 if 39 - 39: i1 % iiI
 if 50 - 50: i1iiIII111 % OooOoo - i1i1i1111I * IiIIii11Ii % Oo . iIiii1i
 if 30 - 30: i1iiIII111
 if 78 - 78: IIiIIiIi11I1 % Iii1i + ooOOO * o00o0OO00O - i1
 if 46 - 46: iIiii1i - iiI / IIiIIiIi11I1 * IIi1i111IiII . oOo0O00
 wizard . close_button . set_label ( "_Close" )
 iIioOOOoooOOOOoo = wizard . close_button . get_preferred_size ( ) . minimum_size . width
 wizard . close_button . set_label ( "_Continue" )
 iI111Iii = wizard . close_button . get_preferred_size ( ) . minimum_size . width
 if 12 - 12: i1i1i1111I % IIi1i111IiII % i1iiIII111
 wizard . close_button . set_size_request ( max ( iIioOOOoooOOOOoo , iI111Iii ) , - 1 )
 if 50 - 50: oOo0O00
def O00 ( widget , toggle_state , wizard ) :
 global O0oOoOoO0o
 O0oOoOoO0o = toggle_state
 if O0oOoOoO0o :
  wizard . close_button . set_label ( "_Continue" )
 else :
  wizard . close_button . set_label ( "_Close" )
  if 32 - 32: I1Ii1I1 % IIiIIiIi11I1 * OooOoo / oOo0O00 + ooOOO
def o00oOo0OOOO00 ( wizard ) :
 ooO = "%s/share/pixmaps/installer_finish.svg" % ( prefix . get_tl_prefix ( ) , )
 if 36 - 36: o00o0OO00O + IiIIii11Ii . i1 + o00o0OO00O
 ooOOOO00O = wizard . add_finish ( OooOoO ,
 text = None ,
 banner_path = ooO ,
 width = 114 ,
 height = 114 ,
 )
 if 77 - 77: ooo0O0oO00 / OooOoo . Iii1i + i1iiIII111 - IIi1i111IiII
 OOooOOoOo0 = tlgtk . Gtk . Box ( orientation = tlgtk . Gtk . Orientation . VERTICAL ,
 halign = tlgtk . Gtk . Align . FILL ,
 valign = tlgtk . Gtk . Align . FILL )
 OOooOOoOo0 . set_spacing ( 12 )
 ooOOOO00O . add ( OOooOOoOo0 )
 if 49 - 49: i1iiIII111 - IIi1i111IiII - OooOoo
 O0oOOoOOO00 = tlgtk . Gtk . Box ( orientation = tlgtk . Gtk . Orientation . HORIZONTAL )
 OOooOOoOo0 . pack_start ( O0oOOoOOO00 , expand = False , fill = False , padding = 0 )
 if 82 - 82: i1 % IIiIIiIi11I1 + IIiIIiIi11I1 + IiIIii11Ii
 II1I1Ii1IIi , i1i11i1I1iI = tlgtk . factory . switch_list ( [ iIIi1111I1 ] )
 OOooOOoOo0 . pack_start ( II1I1Ii1IIi , expand = False , fill = False , padding = 0 )
 if 38 - 38: iIiii1i . o00o0OO00O * oOo0O00 / ooOOO / OooOoo * iIiii1i
 o0O0O000O = i1i11i1I1iI [ 0 ]
 o0O0O000O . set_active ( True )
 o0O0O000O . connect ( "state-set" , O00 , wizard )
 if 70 - 70: IiIIii11Ii
 oooo0 = tlgtk . Label ( wrap = True ,
 xalign = 0.5 ,
 halign = tlgtk . Gtk . Align . FILL ,
 valign = tlgtk . Gtk . Align . START )
 oooo0 . get_style_context ( ) . add_class ( 'dim-label' )
 OOooOOoOo0 . pack_end ( oooo0 , expand = False , fill = False , padding = 0 )
 if 90 - 90: i1i1i1111I % i1 . IiIIii11Ii * IIi1i111IiII / Ii
 OOooOOoOo0 . show_all ( )
 if 73 - 73: IIiIIiIi11I1 * iIiii1i + Iii1i . ooOOO . iiIi1 / iiIi1
 ooOOOO00O . connect ( "page-show" , oooo00OOoo , oooo0 )
 if 72 - 72: iiI * ooo0O0oO00 / IIiIIiIi11I1 + iiI - iiIi1
 if 20 - 20: o00o0OO00O . oOo0O00 . iIiii1i
 if 11 - 11: OooOoo
def OOo0OOO ( ) :
 try :
  locale . setlocale ( locale . LC_ALL , "" )
 except locale . Error as I1IIiIi1iiI1i :
  print ( "\nWarning: Can't set the locale (%s); make sure $LC_* and $LANG are correct\n" %
 I1IIiIi1iiI1i , file = sys . stderr )
  if 87 - 87: i1 * iiIi1
  if 23 - 23: i1iiIII111 / iIiii1i % i1 - I1Ii1I1 - I1Ii1I1
  if 82 - 82: IIiIIiIi11I1 - IIi1i111IiII . ooo0O0oO00 / iIiii1i % Iii1i - I1I
  if 27 - 27: i1i1i1111I * Oo % ii
  if 24 - 24: I1I + Oo - ooOOO
 sys . excepthook = OO0O0oOOO0o
 sys . unraisablehook = ooOooOooO0o0 # novermin
 if 50 - 50: OooOoo % IIiIIiIi11I1 % I1Ii1I1 - o00o0OO00O
 if 82 - 82: I1Ii1I1 * I1Ii1I1 % oOo0O00 - I1Ii1I1 / i1iiIII111
 Ooo0OO ( )
 if 58 - 58: IiIIii11Ii . o00o0OO00O . I1I / ii - iiIi1
 if 84 - 84: o00o0OO00O - ooo0O0oO00 - I1Ii1I1 - i1i1i1111I
 if 73 - 73: i1
 if 38 - 38: ooOOO
 II11 = os . getenv ( "PATH" , "" )
 II11 += ":/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin"
 os . environ [ "PATH" ] = II11
 if 99 - 99: iiIi1 % iiI . ooOOO . ii
 if not tlgtk . init ( wmclass = iIIIII1i111i ) :
  wizard . text_print_wrapped ( "Could not start GTK+. Using text mode fallback..." )
  print ( )
  if 47 - 47: ooo0O0oO00 . I1I % Oo - i1 * oOo0O00
  if 5 - 5: IiIIii11Ii + ooo0O0oO00 . i1 . I1I
  if 95 - 95: IiIIii11Ii * IIi1i111IiII * iIiii1i * IIi1i111IiII / OooOoo
  if not os . isatty ( sys . stdin . fileno ( ) ) :
   print ( "Not attached to a TTY. Cannot proceed with text mode..." )
   tlgtk . message ( iI111iiIi11i ,
 "Graphical mode is currently not possible. "
 "Run this program from a terminal to "
 "get the text mode fallback." )
   sys . exit ( os . EX_USAGE )
   if 27 - 27: iiI . IiIIii11Ii
   if 69 - 69: ii % i1iiIII111 / oOo0O00
 if tlgtk . has_gtk :
  global i1iiiiIIIiIi , Ooo0Ooo , ii1I1iII1I1I
  i1iiiiIIIiIi = tlgtk . linkify_text ( i1iiiiIIIiIi )
  Ooo0Ooo = tlgtk . linkify_text ( Ooo0Ooo )
  ii1I1iII1I1I = tlgtk . linkify_text ( ii1I1iII1I1I )
  if 38 - 38: iiIi1 + Oo * iIiii1i / ooOOO . OooOoo
  if 90 - 90: OooOoo / i1iiIII111
 if CPU_ARCH is X86_64 :
  if 32 - 32: o00o0OO00O - iiI / ooOOO * iIiii1i * ooo0O0oO00 - i1i1i1111I
  if PACKAGE_FORMAT not in ( RPM , DEB ) :
   ii1i11i1 ( "Unsupported package format" ,
 "Could not find a supported package format (RPM or DEB) on this system, " + "or multiple package formats were detected. Install the packages " + "manually and run /opt/thinlinc/sbin/tl-setup." )
   if 82 - 82: IIiIIiIi11I1
   if 66 - 66: IiIIii11Ii + o00o0OO00O - iiI + i1i1i1111I . ooo0O0oO00 * IiIIii11Ii
   sys . exit ( os . EX_CONFIG )
 else :
  ii1i11i1 ( "Unsupported architecture" ,
 "Your architecture (%s) is not supported by ThinLinc.\n" "Refer to the documentation for a list of " "supported platforms." % os . uname ( ) [ 4 ] )
  if 9 - 9: I1I - I1I - ooOOO - oOo0O00 + i1iiIII111
  if 71 - 71: iiI / i1iiIII111 - Ii * Oo . ooo0O0oO00
  sys . exit ( os . EX_CONFIG )
  if 3 - 3: I1Ii1I1
 if os . getuid ( ) != 0 :
  sudorelaunch . sudo_question ( iI111iiIi11i , iI111iiIi11i )
  if 57 - 57: iIiii1i . OooOoo / oOo0O00 * I1Ii1I1
  sys . exit ( os . EX_NOPERM )
  if 36 - 36: IiIIii11Ii
  if 33 - 33: IiIIii11Ii
  if 86 - 86: Ii / oOo0O00 - i1 * i1i1i1111I - Oo * Iii1i
  if 28 - 28: OooOoo . i1 % ooo0O0oO00 % Iii1i
 try :
  II1 = logging . getLogger ( )
  IiI = logging . Formatter ( '%(asctime)s: %(message)s' )
  iIIoo00oo00 = logging . FileHandler ( OOoOoo000O00 , "a" )
  iIIoo00oo00 . setFormatter ( IiI )
  II1 . addHandler ( iIIoo00oo00 )
  II1 . setLevel ( logging . DEBUG )
 except OSError as I1IIiIi1iiI1i :
  ii1i11i1 ( "Log file error" ,
 "Could not open log file '%s': %s" % ( OOoOoo000O00 , I1IIiIi1iiI1i ) )
  sys . exit ( os . EX_OSFILE )
  if 2 - 2: I1Ii1I1 * IiIIii11Ii - I1I * OooOoo * iIiii1i
 logging . info ( "*** ThinLinc installer started ***" )
 if 79 - 79: I1I - Oo . Oo / IIiIIiIi11I1 % iIiii1i + i1iiIII111
 logging . info ( "Architecture: %s" % CPU_ARCH )
 logging . info ( "Distribution: %s" % DISTRIBUTION )
 logging . info ( "Package format: %s" % PACKAGE_FORMAT )
 if 18 - 18: i1i1i1111I + i1
 oOo000o0OO0o = wizard . Wizard ( )
 if 31 - 31: Oo - o00o0OO00O / IIi1i111IiII * i1i1i1111I
 IiI1II1 = "%s/share/pixmaps/installer_intro.png" % ( prefix . get_tl_prefix ( ) , )
 if 88 - 88: i1i1i1111I - Iii1i
 if 76 - 76: Iii1i
 oOo000o0OO0o . set_title ( iI111iiIi11i )
 oOo000o0OO0o . set_intro ( "ThinLinc server installation" ,
 """This program will help you install the ThinLinc software on your system.

Before installing, see the platform specific notes at
%s""" % Ooo0Ooo , "_Start installation" ,
 IiI1II1 ,
 width = 480 ,
 height = 144 ,
 )
 if 34 - 34: Ii . IIiIIiIi11I1
 OooO0O00o0 ( oOo000o0OO0o )
 I1i ( oOo000o0OO0o )
 IiII111I1I ( oOo000o0OO0o )
 iI1Iii ( oOo000o0OO0o )
 O00ooo0000oO ( oOo000o0OO0o )
 if 65 - 65: iiIi1 * iIiii1i - IIiIIiIi11I1
 iI = oOo000o0OO0o . run ( )
 if not iI :
  Iioo0Oo0oO0 ( )
  if 11 - 11: ii % OooOoo % i1i1i1111I + i1i1i1111I + I1I % OooOoo
 logging . info ( "Installation complete." )
 if 69 - 69: iiI - i1i1i1111I * oOo0O00
 if O0oOoOoO0o :
  logging . info ( "Starting tl-setup..." )
  os . execlp ( "/opt/thinlinc/sbin/tl-setup" , "/opt/thinlinc/sbin/tl-setup" )
  if 90 - 90: i1 * i1 . iIiii1i . Oo
  if 59 - 59: Ii % I1Ii1I1 + Iii1i . OooOoo * Iii1i
I111IiI = _thread . get_ident ( )
if 17 - 17: Oo + i1iiIII111 . ooOOO - i1i1i1111I % iiI + i1i1i1111I
def Iioo0Oo0oO0 ( msg = "Installation aborted by user" , exit_code = os . EX_USAGE ) :
 logging . error ( msg )
 sys . exit ( exit_code )
 if 64 - 64: IiIIii11Ii % o00o0OO00O . I1Ii1I1 % IiIIii11Ii
def I11i1iiiiiIIIiii ( ) :
 try :
  if 71 - 71: iIiii1i * i1iiIII111 / iIiii1i / i1iiIII111 * i1i1i1111I + iiI
  if tlgtk . has_gtk and _thread . get_ident ( ) != I111IiI :
   tlgtk . GLib . idle_add ( I11i1iiiiiIIIiii )
   return
   if 48 - 48: iiIi1
  ii1i11i1 ( "Internal error" ,
 "Terminating the ThinLinc server installation wizard. \n" + i1iiiiIIIiIi )
  if 87 - 87: I1Ii1I1
 except :
  pass
  if 29 - 29: IIiIIiIi11I1 . ooo0O0oO00 . oOo0O00 + i1i1i1111I + ii
 sys . exit ( os . EX_SOFTWARE )
 if 59 - 59: IiIIii11Ii
def OO0O0oOOO0o ( exc_type , exc_value , exc_traceback ) :
 try :
  II11iII1Ii1 = traceback . format_exception ( exc_type , exc_value , exc_traceback )
  if 70 - 70: Iii1i / iIiii1i
  if 4 - 4: IiIIii11Ii % Iii1i
  if 43 - 43: IIiIIiIi11I1
  for o0oOO in II11iII1Ii1 :
   for oOOoOOOO000 in o0oOO . splitlines ( ) :
    logging . error ( oOOoOOOO000 )
 except :
  pass
  if 8 - 8: ooOOO * i1i1i1111I
 I11i1iiiiiIIIiii ( )
 if 6 - 6: iIiii1i % IiIIii11Ii
def ooOooOooO0o0 ( e ) :
 OO0O0oOOO0o ( e . exc_type , e . exc_value , e . exc_traceback )
 if 59 - 59: iiI . iiIi1 . IIiIIiIi11I1 / iiI . Ii % iIiii1i
 if 85 - 85: oOo0O00 / ooOOO
if __name__ == "__main__" :
 OOo0OOO ( )
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3
