Syed Jahanzaib Personnel Blog to Share Knowledge !

September 27, 2011

Howto create Windows 7 PPPoE Dialer Installer Package using Auto-iT !


PPPoE Dialer Package Sample

Following is a guide on howto to create Windows 7 PPPoE DIALER Installer Package.  It is based on same principles as my previous Winxp PPPoE Dialer Script.

Being a Linux Lover, I am publishing these codes under GPL (General Public License). You can modify it as per your requirements, redistribute it. Don’t forget to give credit if it helps you :~) Remember it’s not a standard, neat and clean way but It’s very simple and it do the job nicely:)

This script is made for Windows 7 Operating System Only, For windows XP/200x, please follow the below link.
http://aacable.wordpress.com/2011/09/01/howto-create-pppoe-dialer-installer-package-using-auto-it/

Following functions will be performed.

# First it will ask you if you want to continue to install the Dialer.
# Then it will minimize all opened Window to Let user focus the installation,
# Then it will show you the Logo in front(dialer.jpg which is customizable according to your need),
# in Background it will open the Network and sharing center and create new entry for pppoe dialer,
# After creating dialer, it will close the Logo and will show you the message that Dialer have been installed.

This is not fully final Script, Few things have been left intentionally, Following functions will not be performed.

# It will not check Duplicate entries. For example, If you have installed the dialer, and want to re.install it again, It will not check duplicate entries, and will stop on DUPLICATE NAME FOUND, So please Delete Previously Created Dialer with the same name.

Please check and Do Let me know the results.

I have checked It on Windows 7 several times and working fine. The speed of executing functions in program can be + or – in some cases, It can be tuned with the $DELAY variable.

So Here we go . . .

First of all you have to download ‘Auto-it‘ software from its website at

http://www.autoitscript.com/cgi-bin/getfile.pl?autoit3/autoit-v3-setup.exe

I used Latest version: v3.3.6.1, Do full installation of AutoiT.

After installation, launch it by  Goto Start / Programs / Autoit v3  and select SciTE Script Editor

Now an advance Notepad type windows will open, Just paste the following code in it.

(Note: FOR SOME REASONS, Sometimes CODE Does not displayed PROPERLY IN THIS BLOG, IF you face syntax errors,  you can copy the raw code from following location) http://pastebin.com/BhNSMeKx

#cs ----------------------------------------------------------------------------
AutoIt Version : 3.3.6.1
Author : SYED JAHANZAIB
Email : aacable@hotmail.com
Web : http://aacable.wordpress.com
Script Function: Template AutoIt script. for PPPoE Dialer Installer
OS Supported   : Windows 7
Dated          : 27/09/2011
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here

$DELAY = 300
$answer = MsgBox(4, "PPPOE Connection", "This script will create a PPPOE DIALER, Do you want to Continue?")
If $answer = 7 Then
Exit
EndIf

WinMinimizeAll ( )
; Put Logo in front and do installation in background, place dialer.jpg in the same folder
; From you have launched dialer.
SplashImageOn("Please wait Few Seconds While Installer Installs PPPoE Dialer ", "dialer.jpg", 800,650)

$COMPANY_NAME = ("Type Your pppoe service name here")
; Example $COMPANY_NAME = ("MY_ISP")
$DELAY = 300

; Run Windows 7 Network Setup
Run("control.exe /name Microsoft.NetworkAndSharingCenter")
Sleep($DELAY)

; Send TAB 7 times to Select 'setup a new connection'
Send("{TAB 7}")

; Send Enter to Launch 'setup a new connection'
Send("{ENTER}")

; Send Next to select 'Connect to Internet'
Sleep($DELAY)
Send("!n")

; Send 'S' to select 'Setup a new connection anyway
Sleep($DELAY)
Send("!s")

;Check Duplicate Connection ???

Sleep($DELAY)
Send("!n")

; Send 'r' to select 'Broadband PPPoE'
Sleep($DELAY)
Send("!r")

; Send TAB 4 times to Enter 'ISP NAME'
Sleep($DELAY)
Send("{TAB 4}")
Send($COMPANY_NAME)
Sleep($DELAY)

; Send 'c' to connect $COMPANY_NAME service to contiue further
Sleep($DELAY)
Send("!c")

; Send 's' to skip connect '$comapany name' service to contiue further
Sleep($DELAY)
Send("!s")

; Send 'c' to close.
Sleep($DELAY)
Send("!c")

WinClose("Network Connections")
Run("control.exe /name Microsoft.NetworkAndSharingCenter")
Sleep($DELAY)
Send("!F")
Send("c")
SplashOff ( )
Sleep($DELAY)
Run("control ncpa.cpl")
WinWaitActive("Network Connections")
Sleep($DELAY)
;send ( "!{TAB}" )
Sleep($DELAY)
MsgBox(0, "Setup Complete", "Your Dialer have been installed , Click Connect on  " & $COMPANY_NAME & " to initiate Dialing")

Now Open File / Save and name it ‘pppoe-win7-dialer-installer’

Now your script with source code is ready to be compiled in .EXE executable format so any user can install it like any other normal application.

Now Open Tools and click on ‘Compile’ and it will compile the script in .exe format and it will save it to the Desktop or whatever Path You have selected.

Now click on pppoe-win7-dialer-installer.exe and it will install the pppoe dialer and place its shortcut on Desktop. Its always better to test the script fully before compiling it, as compilation is done when your program is fully tested and good to go.

Any suggestions on improvements and enhancements / advancements are most welcome and will be appreciable

Regard’s
SYED JAHANZAIB

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 2,319 other followers