#AutoIt3Wrapper_Run_Obfuscator=Y
#Obfuscator_Parameters=/StripOnly
; #RequireAdmin
; Disable the scripts ability to pause.
Break(0)
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <ServiceControl.au3>
#include <ScreenCapture.au3>
#include <ListViewConstants.au3>
#Include <GuiListView.au3>
#include <StaticConstants.au3>
#include <ProgressConstants.au3>
#include <WinAPIEx.au3>
; Exit if the script hasn't been compiled
If Not @Compiled Then
MsgBox(0, "ERROR", 'Script must be compiled before running!', 5)
Exit
EndIf
Dim $File_Location2 = @ProgramFilesDir & "\InstantSupport\instantsupport.ini"
; Language strings.
$str_Program_Title = "HELPDESK"
$str_Button_InstallService = "Установить как службу"
$str_Button_Exit = "Выход"
$str_MsgBox_Information = "Информация"
$str_MsgBox_ExitInstantSupport = "Вы действиетльного хотите выйти"
$str_MsgBox_ServiceInstallation = "Установка службы"
$str_MsgBox_Error = "Error"
$str_MsgBox_RemoveService = "Удалить службу и программу?"
$str_ServiceEnterAnIDNumber = "Введеите новый ID или оставьте предложенный:"
$str_ServiceInvalidID = "Invalid ID entered, установка службы отменена."
$str_ServiceProxy = "Service installation not supported when using HTTP Proxy."
$str_ErrorInstallService = "Installing service requires administrator privileges."
$str_ErrorStopService = "Stopping VNC services requires administrator privileges."
$str_ErrorUnknownCommand = "Unknown command."
$str_ErrorRepeaterConnectionFailed = "Нет соединения с сервером. Возможно проблемы с интернетом"
$str_EndSupportSession = "Вы действительно хотите выйти?"
$str_CloseOtherVNCServers = "На компьютере обнаружен другой запущенный VNC сервер, для продолжения он будет закрыт. Продолжить?"
;$str_CloseOtherVNCServers = "Another VNC server is running which must be stopped. Try to stop other VNC server?"
$str_ver = "STARTv1.08c.exe"
; Global Vars.
Global $ExtractFiles = True
Global $GenerateID = True
Global $LanMode = False
Global $IDNumber = 123456
Global $WorkingPath = @AppDataDir & "\InstantSupport_Temp_Files"
Global $ProxyEnabled = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable")
; Create unique working path if our default directory already exists. (Possible InstantSupport is already running)
If FileExists( @AppDataDir & "\InstantSupport_Temp_Files" ) Then
$WorkingPath = @AppDataDir & "\InstantSupport_Temp_Files_" & Random( 100000, 999999,1 )
EndIf
; Command line args.
If $cmdline[0] > 0 Then
Switch $cmdline[1]
Case "-installservice"
If IsAdmin() Then
InstallService()
Exit
Else
MsgBox( 0, $str_MsgBox_Error, $str_ErrorInstallService, 30 )
Exit
EndIf
Case "-removeservice"
If IsAdmin() Then
RemoveService()
Exit
Else
; Elevate to admin to remove.
ShellExecuteWait( @ScriptFullPath, "-removeservice", @ScriptDir, "runas")
Exit
EndIf
Case "-stopservices"
If IsAdmin() Then
StopServices()
Exit
Else
MsgBox( 0, $str_MsgBox_Error, $str_ErrorStopService, 30 )
Exit
EndIf
Case Else
MsgBox( 0 , $str_MsgBox_Error, $str_ErrorUnknownCommand, 30 )
Exit
EndSwitch
EndIf
; Extract files.
If $ExtractFiles Then
DirCreate( $WorkingPath )
FileInstall( "InstantSupport_Files\instantsupport.ini", $WorkingPath & "\instantsupport.ini", 1 )
FileInstall( "InstantSupport_Files\logo.jpg", $WorkingPath & "\logo.jpg", 1 )
FileInstall( "InstantSupport_Files\SecureVNCPlugin.dsm", $WorkingPath & "\SecureVNCPlugin.dsm", 1 )
FileInstall( "InstantSupport_Files\ultravnc.ini", $WorkingPath & "\ultravnc.ini", 1 )
FileInstall( "InstantSupport_Files\winvnc.exe", $WorkingPath & "\InstantSupportVNC.exe", 1 )
FileInstall( "InstantSupport_Files\vnc_drv.exe", $WorkingPath & "\vnc_drv.exe", 1 )
FileInstall( "InstantSupport_Files\helpdesk_fixkey.exe", $WorkingPath & "\helpdesk_fixkey.exe", 1 )
; Unblock InstantSupport.exe to prevent "Windows Security" messages.
;ShellExecuteWait($WorkingPath & "\unblock.js", "", @ScriptDir, "")
FileCopy( @ScriptDir & "\" & @ScriptName, $WorkingPath & "\InstantSupport.exe", 9 )
EndIf