Jump to content

autoit program and installer2go


alexity
 Share

Recommended Posts

hi

i've created a program with autoit, this program stay in the tray icon and tell user if another user is connected with vnc(remote control) on the computer

the software works fine, then i convert it to a msi with installer2go, but when i test the msi, the install stop at (starting service ...)

any idea ?

what do i do to start the service ?

Link to comment
Share on other sites

Post your code. We suck at guessing.

#include <WindowsConstants.au3>
#include <Constants.au3>
#Include <Array.au3>
#Include <Misc.au3>
#Include <File.au3>
#include <iNet.au3>
#include<string.au3>

Opt('TrayMenuMode', 1)
Opt('GUIEventOptions', 1)
Opt('TrayIconHide', 1)

Global $title = 'Télémaintenance', $x = 200, $y = 85, $aSave, $sPC, $sPC2, $Visible = true
_Singleton($title)

If Not FileExists(@ScriptDir & '\VNC-Logs') Then DirCreate(@ScriptDir & '\VNC-Logs')

HotKeySet('^!{F10}', '_Exit')
HotKeySet('^+{F10}', '_Visible')
TraySetToolTip($title & " : " & $Visible)
TCPStartup()
_check()
AdlibEnable('_check', 3000)

While 1
    Sleep(10000)
WEnd

Func _check()
    Local $PCName, $aPC = _GetConnectionFromPort()
    If UBound($aSave) <> UBound($aPC) Then
  $sPC = ""
        $aSave = $aPC
        For $i = 0 To UBound($aPC) -1
   $PCName = _TCPIpToName($aPC[$i])
            $sPC &= $aPC[$i] & ' (' & $PCName & ')' & @CRLF
            _FileWriteLog(@ScriptDir & '\VNC-Logs\VNC-Connections.log', 'Active connection to: ' & $aPC[$i] & ' (' & $PCName & ')')
        Next
  $sPC = StringTrimRight($sPC, 2)
  $sPC2= _StringInsert($sPC, "Depuis le poste : ", 0)
  If $Visible Then ToolTip($sPC2, @DesktopWidth - $x, @DesktopHeight - $y, $title)
  If Not IsArray($aPC) Then  _FileWriteLog(@ScriptDir & '\VNC-Logs\VNC-Connections.log', 'No more connection active!')
    EndIf
EndFunc

Func _Exit()
TCPShutdown()
    Exit
EndFunc

Func _Visible()
$Visible = Not $Visible
If $Visible Then
  ToolTip($sPC, @DesktopWidth - $x,@DesktopHeight - $y, $title)
Else
  ToolTip("")
EndIf
TraySetToolTip($title & " : " & $Visible)
EndFunc

Func _GetConnectionFromPort($sPort = '5900')
    ; funkey 17.06.2009
    ; returns IP of connected PC's depending on the port
    ; standard-port is 5900 for VNC
    Local $sErgebnis, $aPort, $sLang = StringRight(@OSLang, 2), $sInfo = "ESTABLISHED"
    Local $pid = Run(@ComSpec & " /c " & 'netstat -np TCP |findstr ":'&$sPort&'"', "", @SW_HIDE, $STDOUT_CHILD)
If $sLang = "07" Then $sInfo = "HERGESTELLT" ; german
    Do
        $sErgebnis &= StdoutRead($pid)
    Until @error
    $aPort = StringSplit($sErgebnis, @CRLF, 3)
    For $i = UBound($aPort) - 1 To 0 Step -1
        If StringInStr($aPort[$i], $sInfo) Then
            $aPort[$i] = StringRegExpReplace($aPort[$i], '(\s+)(\S+)(\s+)(\S+)(\s+)(\S+):(\S+)(\s+)(\S+)', '$6')
        Else
            _ArrayDelete($aPort, $i)
        EndIf
    Next
    If Not IsArray($aPort) Then Return SetError(1, 0, "")
    Return $aPort
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...