KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Form with dynamic button properties

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
chadox
KiXforms Dabbler
KiXforms Dabbler


Joined: 03 Jul 2006
Posts: 5

PostPosted: Mon Jul 03, 2006 4:12 pm    Post subject: Form with dynamic button properties Reply with quote

Hi guys. I'm fairly new to KiXforms.net. I've been using KiXtart for a while now, but this new gui stuff is very nice.

I've been working on a small app for my boss for a little while now. I have it done and ready to go, but I thought I would add one last touch.

My form's purpose is an installer program. It will assist users to install programs (specifically anti-spyware programs) onto their computer.

I have checks built in to check for existing versions of some programs. If they are older versions, the user is prompted to uninstall the previous version. If they are the current version, clicking on the button launches the program.

What I thought I would like to do is change button labels and colors dynamically. I have tried a few things to get this to work, but Ican't quite figure it out.

I have a few button properties that get set "dynamically."

For example, let's work with my Ad-Aware button...

When the main form starts it runs its checks to find out if previous or up to date versions of software is found on the PC.

If a current version of Ad-Aware is found, the folowing two variables are set for the button's display:

Code:
$btnaawcolor = $System.Color.FromName("Khaki")
$btnaawtext ="Ad-Aware SE Personal 1.06"


If an old version, or no version at all is found, the following two variables are set for the button's display:

Code:
$btnaawcolor = $System.Color.FromName("Red")
$btnaawtext = "Install Ad-Aware SE Personal"


If needed, the button properties are:

Code:
$btnadaware = $System.Button()
$btnadaware.BackColor = $btnaawcolor
$btnadaware.Left = 152
$btnadaware.TabStop = -1  ;True
$btnadaware.Text = $btnaawtext
$btnadaware.Top = 100
$btnadaware.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnadaware)


My problem with doing this is...

The checks work fine. When the main form is launched, the appropriate button text and color are displayed. If no version of Ad-Aware is found on the PC, it shows the red button with the text of "Install Ad-Aware SE Personal".

However, after the user clicks the button to install Ad-Aware and ad-aware is installed, I would like the button to dynamically update with the new properties. I have managed to rerun the checks and hide and show the form, but the form still has the old button properties.

The only way the button gets updated is by exiting the program and restarting.

Any ideas out there from you more advanced scripters?

Thanks in advance for your help,

chadox
Back to top
View user's profile Send private message Visit poster's website
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Mon Jul 03, 2006 6:33 pm    Post subject: Reply with quote

Howdy chadox, and welcome to KiXforms;

I suspect you are very close to having it the way you need it, could you attach your full script so we can look it over then offer suggestions?

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
chadox
KiXforms Dabbler
KiXforms Dabbler


Joined: 03 Jul 2006
Posts: 5

PostPosted: Mon Jul 03, 2006 7:23 pm    Post subject: Reply with quote

I suppose I could. What I'm going to post is the finalized code prior attempting making the buttons dynamic. However, I must warn you...

1. I am not a programmer. Therefore, I make some use of your dreaded Goto statements that I've seen many of you kick around as being horrible programmer's etiquette. It makes sense to me, so I use it.

2. There are (obviously, given the nature of my project) many references to external programs being run.

3. This is a big tab form.... containing just over 900 lines of code. I'm really only interested in making the first three buttons (ad-aware, spybot, and spyware blaster) being dynamically updatated as most everything else can be run directly from the CD.

The purpose of this project is for us to distribute a free CD to any customers or potential customers to give them a starting point for cleaning up their PCs.

Are you certain you want to sift through all of the code, or would you prefer me only to post relevant sections?
Back to top
View user's profile Send private message Visit poster's website
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Mon Jul 03, 2006 7:45 pm    Post subject: Reply with quote

I certainly understand how many lines of code it takes to make a app out of KiXtart and KiXforms, my baby ‘KiXforms Designer .Net 2.0 (Beta)’ is over 20,000 lines including Image Strings, 16,000 lines without. You are correct ‘GoTo’ statements is not a good way to go, but you have to start somewhere and I commend you on the effort, and I understand that there will be references to files that may not be available. If you post your code maybe we can help you refine your code as well as help you with your question(s).
_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
chadox
KiXforms Dabbler
KiXforms Dabbler


Joined: 03 Jul 2006
Posts: 5

PostPosted: Mon Jul 03, 2006 8:12 pm    Post subject: Reply with quote

roger, here goes... go easy on me - it's my first attempt Laughing

Code:
Break On
SetConsole ("HIDE")

Goto "begin"

:begin
  $netframeworkinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 1.1  (1033)")
  If $netframeworkinstalled = "1" Goto "checkos"
  Else Goto "installnetframework"
  EndIf

:installnetframework
  Shell @SCRIPTDIR + "\..\REDIST\dotnetfx.exe /q"
  Goto "begin"

:checkos
  If @INWIN = "2" Goto "regassembly9x"
  Else If @INWIN = "1" Goto "regassemblynt"
  EndIf

:regassemblynt
  Copy @SCRIPTDIR + "\Kixforms.System.dll" "%SystemRoot%\system32" /r
  Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%SystemRoot%\system32" /r
  Shell "%SystemRoot%\Microsoft.NET\Framework\v1.1.4322\regasm.exe %SystemRoot%\system32\Kixforms.System.dll /tlb /codebase /silent"
  Goto "runcd"

:regassembly9x
  Copy @SCRIPTDIR + "\Kixforms.System.dll" "%WinDir%\system" /r
  Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%WinDir%\system" /r
  Shell "%WinDir%\Microsoft.NET\Framework\V1.1.4322\regasm.exe %windir%\system\Kixforms.System.dll /tlb /codebase /silent"
  Goto "runcd"

:runcd
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

$FormSplash = $System.Form()
$FormSplash.ControlBox = 0  ;True
$FormSplash.FormBorderStyle = 3  ;FormBorderStyle_FixedDialog
$FormSplash.MaximizeBox = 0  ;False
$FormSplash.MinimizeBox = 0  ;False
$FormSplash.StartPosition = 1  ;FormStartPosition_Center
$FormSplash.Size = $System.Size(600,195) ;(Width,Height)
$FormSplash.Text = "Gipetto Tech - We Get The Bugs Out!"

$PictureBoxSplash = $System.PictureBox()
$PictureBoxSplash.BorderStyle = 1  ;FixedSingle
$PictureBoxSplash.Height = 195
$PictureBoxSplash.Left = 0
$PictureBoxSplash.Top = 0
$PictureBoxSplash.Width = 600
$nul = $FormSplash.Controls.Add($PictureBoxSplash)

$PictureBoxSplash.Image = $System.Bitmap(@SCRIPTDIR + "\splash.jpg")
$Iexplore = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE","")
$GTIcon = $System.Icon.FromFile(@SCRIPTDIR + "\gipey.ico")
$GTLogo = $System.Bitmap(@SCRIPTDIR + "\gtlogo.bmp")
$GTIntro = @SCRIPTDIR + "\bugsout.wav"
$GTCommercial = @SCRIPTDIR + "commercial.wav"

$FormSplash.Show  ;Displays the Form
Play File $GTIntro
$FormSplash.Activate
$FormSplash.Hide ;Closes the Form

While $FormSplash.Visible
   $Nul = Execute($FormSplash.DoEvents())
Loop

$Form1 = $System.Form()
$Form1.BackColor = $System.Color.FromName("YellowGreen")
$Form1.FormBorderStyle = 1  ;FormBorderStyle_FixedSingle
$Form1.MaximizeBox = 0  ;False
$Form1.MinimizeBox = 0  ;False
$Form1.StartPosition = 1  ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(507,453) ;(Width,Height)
$Form1.Text = "Gipetto Cleanup CD"
$Form1.Icon = $GTIcon

$TabControl1 = $System.TabControl()
$TabControl1.Height = 404
$TabControl1.Left = 8
$TabControl1.TabStop = -1  ;True
$TabControl1.Top = 9
$TabControl1.Width = 482
$nul = $Form1.Controls.Add($TabControl1)

$TabControl1TabPage1 = $System.TabPage()
$TabControl1TabPage1.BackColor = $System.Color.FromName("White")
$TabControl1TabPage1.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage1.Text = "Spyware Removal Tools"
$nul = $TabControl1.Controls.Add($TabControl1TabPage1)

$btnadaware = $System.Button()
$btnadaware.BackColor = $System.Color.FromName("Khaki")
$btnadaware.Left = 152
$btnadaware.TabStop = -1  ;True
$btnadaware.Text = "Ad-Aware SE Personal - 1.06"
$btnadaware.Top = 100
$btnadaware.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnadaware)

$btnspybot = $System.Button()
$btnspybot.BackColor = $System.Color.FromName("Khaki")
$btnspybot.Left = 152
$btnspybot.TabStop = -1  ;True
$btnspybot.Text = "Spybot Search && Destroy - 1.4"
$btnspybot.Top = 135
$btnspybot.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnspybot)

$btnsblaster = $System.Button()
$btnsblaster.BackColor = $System.Color.FromName("Khaki")
$btnsblaster.Left = 152
$btnsblaster.TabStop = -1  ;True
$btnsblaster.Text = "Spyware Blaster - 3.5.1"
$btnsblaster.Top = 170
$btnsblaster.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnsblaster)

$btnmrt = $System.Button()
$btnmrt.BackColor = $System.Color.FromName("Khaki")
$btnmrt.Left = 152
$btnmrt.TabStop = -1  ;True
$btnmrt.Text = "Microsoft Windows® MRT"
$btnmrt.Top = 205
$btnmrt.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnmrt)

$btnsmitrem = $System.Button()
$btnsmitrem.BackColor = $System.Color.FromName("Khaki")
$btnsmitrem.Left = 152
$btnsmitrem.TabStop = -1  ;True
$btnsmitrem.Text = "SmitRem - 2.8"
$btnsmitrem.Top = 240
$btnsmitrem.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnsmitrem)

$btnexit1 = $System.Button()
$btnexit1.BackColor = $System.Color.FromName("YellowGreen")
$btnexit1.Left = 343
$btnexit1.Text = "E&xit Program"
$btnexit1.Top = 347
$btnexit1.Width = 123
$nul = $TabControl1TabPage1.Controls.Add($btnexit1)

$PictureBox1 = $System.PictureBox()
$PictureBox1.Height = 67
$PictureBox1.Left = 221
$PictureBox1.Top = 8
$PictureBox1.Width = 245
$nul = $TabControl1TabPage1.Controls.Add($PictureBox1)

$PictureBox1.Image = $GTLogo

$btntcprepair = $System.Button()
$btntcprepair.BackColor = $System.Color.FromName("Khaki")
$btntcprepair.Left = 152
$btntcprepair.TabStop = -1  ;True
$btntcprepair.Text = "TCP/IP Stack Repair"
$btntcprepair.Top = 275
$btntcprepair.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btntcprepair)

$Label2 = $System.Label()
$Label2.BackColor = $System.Color.FromName("Transparent")
$Label2.Left = 1
$Label2.Text = "ver 1.0 - 07/2006"
$Label2.TextAlign = 16  ;MiddleLeft
$Label2.Top = 354
$nul = $TabControl1TabPage1.Controls.Add($Label2)

$TabControl1TabPage3 = $System.TabPage()
$TabControl1TabPage3.BackColor = $System.Color.FromName("White")
$TabControl1TabPage3.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage3.Text = "Antivirus Tools"
$nul = $TabControl1.Controls.Add($TabControl1TabPage3)

$Label3 = $System.Label()
$Label3.BackColor = $System.Color.FromName("Transparent")
$Label3.Left = 1
$Label3.Text = "ver 1.0 - 07/2006"
$Label3.TextAlign = 16  ;MiddleLeft
$Label3.Top = 354
$nul = $TabControl1TabPage3.Controls.Add($Label3)

$PictureBox3 = $System.PictureBox()
$PictureBox3.BackColor = $System.Color.FromName("Transparent")
$PictureBox3.Height = 67
$PictureBox3.Left = 221
$PictureBox3.Top = 8
$PictureBox3.Width = 245
$nul = $TabControl1TabPage3.Controls.Add($PictureBox3)

$PictureBox3.Image = $GTLogo

$btnexit2 = $System.Button()
$btnexit2.BackColor = $System.Color.FromName("YellowGreen")
$btnexit2.Left = 343
$btnexit2.Text = "E&xit Program"
$btnexit2.Top = 347
$btnexit2.Width = 123
$nul = $TabControl1TabPage3.Controls.Add($btnexit2)

$btnsysclean = $System.Button()
$btnsysclean.BackColor = $System.Color.FromName("Khaki")
$btnsysclean.Left = 152
$btnsysclean.TabStop = -1  ;True
$btnsysclean.Text = "Trend Micro SYSCLEAN"
$btnsysclean.Top = 100
$btnsysclean.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnsysclean)

$btnvcleaner = $System.Button()
$btnvcleaner.BackColor = $System.Color.FromName("Khaki")
$btnvcleaner.Left = 152
$btnvcleaner.TabStop = -1  ;True
$btnvcleaner.Text = "AVG Vcleaner"
$btnvcleaner.Top = 135
$btnvcleaner.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnvcleaner)

$btnstinger = $System.Button()
$btnstinger.BackColor = $System.Color.FromName("Khaki")
$btnstinger.Left = 152
$btnstinger.TabStop = -1  ;True
$btnstinger.Text = "McAfee Stinger"
$btnstinger.Top = 170
$btnstinger.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnstinger)

$btnavgfree = $System.Button()
$btnavgfree.BackColor = $System.Color.FromName("Khaki")
$btnavgfree.Left = 152
$btnavgfree.TabStop = -1  ;True
$btnavgfree.Text = "AVG Antivirus Free Edition"
$btnavgfree.Top = 205
$btnavgfree.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnavgfree)

$btnavgpro = $System.Button()
$btnavgpro.BackColor = $System.Color.FromName("Khaki")
$btnavgpro.Left = 152
$btnavgpro.TabStop = -1  ;True
$btnavgpro.Text = "AVG Antivirus Professional"
$btnavgpro.Top = 240
$btnavgpro.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnavgpro)

$TabControl1TabPage4 = $System.TabPage()
$TabControl1TabPage4.BackColor = $System.Color.FromName("White")
$TabControl1TabPage4.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage4.Text = "Web Links"
$nul = $TabControl1.Controls.Add($TabControl1TabPage4)

$btnexit3 = $System.Button()
$btnexit3.BackColor = $System.Color.FromName("YellowGreen")
$btnexit3.Left = 343
$btnexit3.Text = "E&xit Program"
$btnexit3.Top = 347
$btnexit3.Width = 123
$nul = $TabControl1TabPage4.Controls.Add($btnexit3)

$Label4 = $System.Label()
$Label4.BackColor = $System.Color.FromName("Transparent")
$Label4.Left = 1
$Label4.Text = "ver 1.0 - 07/2006"
$Label4.TextAlign = 16  ;MiddleLeft
$Label4.Top = 354
$nul = $TabControl1TabPage4.Controls.Add($Label4)

$PictureBox4 = $System.PictureBox()
$PictureBox4.BackColor = $System.Color.FromName("Transparent")
$PictureBox4.Height = 67
$PictureBox4.Left = 221
$PictureBox4.Top = 8
$PictureBox4.Width = 245
$nul = $TabControl1TabPage4.Controls.Add($PictureBox4)

$PictureBox4.Image = $GTLogo

$btnewidoscan = $System.Button()
$btnewidoscan.BackColor = $System.Color.FromName("Khaki")
$btnewidoscan.Left = 46
$btnewidoscan.TabStop = -1  ;True
$btnewidoscan.Text = "ewido networks Online Scan"
$btnewidoscan.Top = 100
$btnewidoscan.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnewidoscan)

$btntmantispyware = $System.Button()
$btntmantispyware.BackColor = $System.Color.FromName("Khaki")
$btntmantispyware.Left = 46
$btntmantispyware.TabStop = -1  ;True
$btntmantispyware.Text = "Trend Micro Anti-Spyware"
$btntmantispyware.Top = 135
$btntmantispyware.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btntmantispyware)

$btncapestscan = $System.Button()
$btncapestscan.BackColor = $System.Color.FromName("Khaki")
$btncapestscan.Left = 46
$btncapestscan.TabStop = -1  ;True
$btncapestscan.Text = "CA eTrust PestScan"
$btncapestscan.Top = 170
$btncapestscan.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btncapestscan)

$btntmhousecall = $System.Button()
$btntmhousecall.BackColor = $System.Color.FromName("Khaki")
$btntmhousecall.Left = 46
$btntmhousecall.TabStop = -1  ;True
$btntmhousecall.Text = "Trend Micro HouseCall"
$btntmhousecall.Top = 205
$btntmhousecall.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btntmhousecall)

$btncaantivirus = $System.Button()
$btncaantivirus.BackColor = $System.Color.FromName("Khaki")
$btncaantivirus.Left = 46
$btncaantivirus.TabStop = -1  ;True
$btncaantivirus.Text = "CA eTrust Antivirus Web Scan"
$btncaantivirus.Top = 240
$btncaantivirus.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btncaantivirus)

$btnpandaactivescan = $System.Button()
$btnpandaactivescan.BackColor = $System.Color.FromName("Khaki")
$btnpandaactivescan.Left = 46
$btnpandaactivescan.TabStop = -1  ;True
$btnpandaactivescan.Text = "Panda Software ActiveScan"
$btnpandaactivescan.Top = 275
$btnpandaactivescan.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnpandaactivescan)

$btnwindowsdefenderhome = $System.Button()
$btnwindowsdefenderhome.BackColor = $System.Color.FromName("Khaki")
$btnwindowsdefenderhome.Left = 258
$btnwindowsdefenderhome.TabStop = -1  ;True
$btnwindowsdefenderhome.Text = "Microsoft Windows® Defender"
$btnwindowsdefenderhome.Top = 100
$btnwindowsdefenderhome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnwindowsdefenderhome)

$btnadawarehome = $System.Button()
$btnadawarehome.BackColor = $System.Color.FromName("Khaki")
$btnadawarehome.Left = 258
$btnadawarehome.TabStop = -1  ;True
$btnadawarehome.Text = "Lavasoft Ad-Aware Homepage"
$btnadawarehome.Top = 135
$btnadawarehome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnadawarehome)

$btnspybothome = $System.Button()
$btnspybothome.BackColor = $System.Color.FromName("Khaki")
$btnspybothome.Left = 258
$btnspybothome.TabStop = -1  ;True
$btnspybothome.Text = "Spybot S&&D Homepage"
$btnspybothome.Top = 170
$btnspybothome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnspybothome)

$btnspywareblasterhome = $System.Button()
$btnspywareblasterhome.BackColor = $System.Color.FromName("Khaki")
$btnspywareblasterhome.Left = 258
$btnspywareblasterhome.TabStop = -1  ;True
$btnspywareblasterhome.Text = "Spyware Blaster Homepage"
$btnspywareblasterhome.Top = 205
$btnspywareblasterhome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnspywareblasterhome)

$btnewidohome = $System.Button()
$btnewidohome.BackColor = $System.Color.FromName("Khaki")
$btnewidohome.Left = 258
$btnewidohome.TabStop = -1  ;True
$btnewidohome.Text = "ewido networks Homepage"
$btnewidohome.Top = 240
$btnewidohome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnewidohome)

$btngrisofthome = $System.Button()
$btngrisofthome.BackColor = $System.Color.FromName("Khaki")
$btngrisofthome.Left = 258
$btngrisofthome.TabStop = -1  ;True
$btngrisofthome.Text = "Grisoft AVG Homepage"
$btngrisofthome.Top = 275
$btngrisofthome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btngrisofthome)

$TabControl1TabPage5 = $System.TabPage()
$TabControl1TabPage5.BackColor = $System.Color.FromName("White")
$TabControl1TabPage5.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage5.Text = "Gipetto Live!"
$nul = $TabControl1.Controls.Add($TabControl1TabPage5)

$Label5 = $System.Label()
$Label5.BackColor = $System.Color.FromName("Transparent")
$Label5.Left = 1
$Label5.Text = "ver 1.0 - 07/2006"
$Label5.TextAlign = 16  ;MiddleLeft
$Label5.Top = 354
$nul = $TabControl1TabPage5.Controls.Add($Label5)

$PictureBox5 = $System.PictureBox()
$PictureBox5.BackColor = $System.Color.FromName("Transparent")
$PictureBox5.Height = 67
$PictureBox5.Left = 221
$PictureBox5.Top = 8
$PictureBox5.Width = 245
$nul = $TabControl1TabPage5.Controls.Add($PictureBox5)

$PictureBox5.Image = $GTLogo

$btnexit4 = $System.Button()
$btnexit4.BackColor = $System.Color.FromName("YellowGreen")
$btnexit4.Left = 343
$btnexit4.Text = "E&xit Program"
$btnexit4.Top = 347
$btnexit4.Width = 123
$nul = $TabControl1TabPage5.Controls.Add($btnexit4)

$installglive = $System.Button()
$installglive.BackColor = $System.Color.FromName("Khaki")
$installglive.Left = 152
$installglive.Text = "Install Gipetto Live"
$installglive.Top = 240
$installglive.Width = 166
$nul = $TabControl1TabPage5.Controls.Add($installglive)

$Label2 = $System.Label()
$Label2.Height = 132
$Label2.Left = 152
$Label2.Text = "Gipetto Live is a remote support program that will allow a Gipetto Support Professional to take control of your computer as if we were sitting directly in front of it.  This service is not free and will not work for you without first calling Gipetto Tech - (877) 921-6373."
$Label2.TextAlign = 16  ;MiddleLeft
$Label2.Top = 100
$Label2.Width = 166
$nul = $TabControl1TabPage5.Controls.Add($Label2)

$AboutCD = $System.TabPage()
$AboutCD.BackColor = $System.Color.FromName("White")
$AboutCD.BorderStyle = 2  ;Fixed3D
$AboutCD.Text = "About"
$nul = $TabControl1.Controls.Add($AboutCD)

$Label6 = $System.Label()
$Label6.BackColor = $System.Color.FromName("Transparent")
$Label6.Left = 1
$Label6.Text = "ver 1.0 - 07/2006"
$Label6.TextAlign = 16  ;MiddleLeft
$Label6.Top = 354
$nul = $AboutCD.Controls.Add($Label6)

$PictureBox6 = $System.PictureBox()
$PictureBox6.BackColor = $System.Color.FromName("Transparent")
$PictureBox6.Height = 67
$PictureBox6.Left = 221
$PictureBox6.Top = 8
$PictureBox6.Width = 245
$nul = $AboutCD.Controls.Add($PictureBox6)

$PictureBox6.Image = $GTLogo

$btnexit5 = $System.Button()
$btnexit5.BackColor = $System.Color.FromName("YellowGreen")
$btnexit5.Left = 343
$btnexit5.Text = "E&xit Program"
$btnexit5.Top = 347
$btnexit5.Width = 123
$nul = $AboutCD.Controls.Add($btnexit5)

$Label1 = $System.Label()
$Label1.Height = 198
$Label1.Left = 46
$Label1.Text = "Gipetto Tech services and repairs most brands, makes and models of computers. With our trained professional team we offer a high level of quality service . Forget about unplugging and hauling your computer around town, trying to find someone to fix it in a timely manner. Remember, we fix your computer in your home or office and we do it when you schedule the service. Concerned about " + Chr(34) + "tech jargon" + Chr(34) + "? Our Gipetto Techs are trained to discuss your situation in " + Chr(34) + "simple English" + Chr(34) + "." + Chr(10) + Chr(10) +"If you just bought that Dell, Compaq, Gateway or unbranded computer and you need some help, call us. We are experts in setting up the computer the way you want." + Chr(10) + Chr(10) + "Gipetto Tech phone number:  (877) 921-6373" + Chr(10) + "Gipetto Tech website:  http://www.gipetto.com/"
$Label1.TextAlign = 16  ;MiddleLeft
$Label1.Top = 100
$Label1.Width = 378
$nul = $AboutCD.Controls.Add($Label1)

$btnadaware.Click = "adaware_Click()"
$btnspybot.Click = "spybot_Click()"
$btnsblaster.Click = "spyblaster_Click()"
$btnmrt.Click = "mrt_Click()"
$btnsmitrem.Click = "smitrem_Click()"
$btntcprepair.Click = "tcprepair_Click()"
$btnsysclean.Click = "sysclean_Click()"
$btnvcleaner.Click = "vcleaner_Click()"
$btnstinger.Click = "stinger_Click()"
$btnavgfree.Click = "avgfree_Click()"
$btnavgpro.Click = "avgpro_Click()"
$btnewidoscan.Click = "ewidoscan_Click()"
$btntmantispyware.Click = "tmas_Click()"
$btncapestscan.Click = "capestscan_Click()"
$btntmhousecall.Click = "tmhousecall_Click()"
$btncaantivirus.Click = "caav_Click()"
$btnpandaactivescan.Click = "pandaactivescan_Click()"
$btnwindowsdefenderhome.Click = "windowsdefender_Click()"
$btnadawarehome.Click = "adawarehome_Click()"
$btnspybothome.Click = "spybothome_Click()"
$btnspywareblasterhome.Click = "spywareblasterhome_Click()"
$btnewidohome.Click = "ewidohome_Click()"
$btngrisofthome.Click = "grisofthome_Click()"
$installglive.Click = "glive_Click()"
$btnexit1.Click = "exit_Click()"
$btnexit2.Click = "exit_Click()"
$btnexit3.Click = "exit_Click()"
$btnexit4.Click = "exit_Click()"
$btnexit5.Click = "exit_Click()"

$Form1.Center
$Form1.Show  ;Displays the Form

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0

Function adaware_Click()
  $adawareinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal")
  If $adawareinstalled = "1" Goto "chkaawversion"
  Else Goto "installaaw"
  EndIf

:chkaawversion
  $aawversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal","DisplayVersion")
  If $aawversion = "1.06" Goto "aawdefsupdate"
  Else Goto "installaaw"
  EndIf

:aawdefsupdate
  $adawarekey = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal","DisplayIcon")
  $aawlocation = Left($adawarekey, Len($adawarekey)-3)
  $adawarefolder = Left($aawlocation, Len($aawlocation)-13)
  $aawrefs = CompareFileTimes($adawarefolder + "\defs.ref", @SCRIPTDIR + "\..\astools\defs.ref")
  If $aawrefs = -1 Goto "aawupdate"
  Else Goto "runaaw106"
  EndIf

:aawupdate
  Copy @SCRIPTDIR + "\..\astools\defs.ref" $adawarefolder /r
  Goto "aawdefsupdate"

:runaaw106 
  Shell Chr(34) + $aawlocation + Chr(34)
Goto "endaaw"

:installaaw
 $Selectioncapest = MessageBox("Ad-Aware SE 1.06 was not found on your computer.  Would you like to continue to install Lavasoft Ad-Aware?", "Installing Ad-Aware SE 1.06", 36)
  If $Selectioncapest = 6
      Shell @SCRIPTDIR + "\..\astools\aawsepersonal.exe"
  EndIf
Goto "endaaw"

:endaaw
EndFunction

Function spybot_Click()
  $spybotinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1")
  If $spybotinstalled = "1" Goto "chkspybotversion"
  Else Goto "installspybot"
  EndIf

:chkspybotversion
  $spybotversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","DisplayVersion")
  $spybotprogram = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","DisplayIcon")
  $spybotfolder = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","InstallLocation")
  If $spybotversion = "1.4" Goto "runspybot14"
  Else Goto "removespybot"
  EndIf

:removespybot
  $spybotremove = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","UninstallString")
  $Selectionspyremove = MessageBox("Spybot Search & Destroy was found on your computer, but it is NOT version 1.4.  Would you like to remove Spybot Search & Destroy now (this is required in order to get version 1.4 to install properly)?", "Remove previous version of Spybot", 36)
  If $Selectionspyremove = 6 Goto "uninstallspybot"
  Else Goto "endspybot"
  EndIf

:uninstallspybot
   Run $spybotremove
   $Form1.Hide
   Quit
Goto "endspybot"

:runspybot14 
  ;MessageBox ("Please be patient, Spybot Search & Destroy may take a few minutes to start.  We are running an automatic update process that happens in the backgroung.  Spybot will start automatically once the automatic update is done.  Please click Ok to continue with the automatic update process.", "Please be patient!", 64)
  Shell Chr(34) + $spybotprogram + Chr(34) + " /autoupdate /autoclose"
  Shell Chr(34) + $spybotprogram + Chr(34) + " /allhives"
Goto "endspybot"

:installspybot
 $Selectioninstsb = MessageBox("Spybot Search & Destroy 1.4 was not found on your computer.  Would you like to continue to install Spybot?", "Installing Spybot Search & Destroy 1.4", 36)
  If $Selectioninstsb = 6
      Shell @SCRIPTDIR + "\..\astools\spybotsd14.exe"
    ;Shell @SCRIPTDIR + "\..\astools\spybotsd_advcheck.exe"
    ;Shell @SCRIPTDIR + "\..\astools\spybotsd_tools.exe"
    ;Shell @SCRIPTDIR + "\..\astools\spybotsd_includes.exe"
  EndIf
Goto "endspybot"

:endspybot
EndFunction

Function spyblaster_Click()
  $sblasterinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1")
  If $sblasterinstalled = 1 Goto "chksblasterversion"
  Else Goto "installsblaster"
  EndIf

:chksblasterversion
  $sblasterversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","DisplayVersion")
  $sblasterprogram = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","DisplayIcon")
  $sblasterfolder = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","InstallLocation")
  If $sblasterversion = "3.5.1" Goto "runsblaster351"
  Else Goto "removesblaster"
  EndIf

:removesblaster
  $sblasterremove = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","UninstallString")
  $Selectionspyremove = MessageBox("Spyware Blaster was found on your computer, but it is NOT version 3.5.1.  Would you like to remove Spyware Blaster now (this is required in order to get version 3.5.1 to install properly)?", "Remove previous version of Spyware Blaster", 36)
  If $Selectionspyremove = 6 Goto "uninstallsblaster"
  Else Goto "endsblaster"
  EndIf

:uninstallsblaster
   Shell $sblasterremove
Goto "endsblaster"

:runsblaster351
   Shell Chr(34) + $sblasterprogram + Chr(34)
 Goto "endsblaster"

:installsblaster
 $Selectioninstsb = MessageBox("Spyware Blaster 3.5.1 was not found on your computer.  Would you like to continue to install it now?", "Installing Spyware Blaster 3.5.1", 36)
  If $Selectioninstsb = 6
      Shell @SCRIPTDIR + "\..\astools\spywareblastersetup351.exe"
  EndIf
Goto "endsblaster"

:endsblaster
EndFunction

Function mrt_Click()
  If @PRODUCTTYPE = "Windows 95" Goto "mrtnotsupported"
  Else If @PRODUCTTYPE = "Windows 98" Goto "mrtnotsupported"
  Else If @PRODUCTTYPE = "Windows Me" Goto "mrtnotsupported"
  Else If @PRODUCTTYPE = "Windows NT Workstation" Goto "mrtnotsupported"
  Else If @PRODUCTTYPE = "Windows NT Server" Goto "mrtnotsupported"
  Else If @PRODUCTTYPE = "Windows NT Domain Controller" Goto "mrtnotsupported"
  Else If @PRODUCTTYPE = "Windows 2000 Professional" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows 2000 Server" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows 2000 Domain Controller" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows XP Home Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows XP Professional" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows XP Professional Tablet PC" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows XP Media Center Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows XP Starter Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Starter Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Server 2003" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Server 2003 Domain Controller" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Server 2003 R2" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Server 2003 R2 Domain Controller" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Home Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Professional" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Professional Tablet PC" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Media Center Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Starter Edition" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Server" Goto "mrtsupported"
  Else If @PRODUCTTYPE = "Windows Vista Domain Controller" Goto "mrtsupported"
  Else Goto "endmrt"

:mrtnotsupported
  $mrtselectiona = MessageBox("Malicious Software Removal Tool will not run on your current operating system (" + @PRODUCTTYPE + ").  Do you still wish to launch the Malicious Software Removal Tool homepage so you can read about Malicious Software Removal Tool?", "Launch Malicious Software Removal Tool homepage", 36) 
  If $mrtselectiona = 6
    Run $Iexplore + " http://www.microsoft.com/security/malwareremove/default.mspx"
  EndIf
Goto "endmrt"

:mrtsupported
  $mrtselectionb = MessageBox("Microsoft Windows® Malicious Software Removal Tool is a free tool from Microsoft that comes in from Windows® Update.  Would you like to run Windows® Update now to verify you have the latest version of Microsoft Windows® Malicious Software Removal Tool?" + Chr(10) + Chr(10) + "Clicking yes will launch Windows Update." + Chr(10) + "Clicking no will allow you to launch the program.", "Launch Windows® Update to update MRT?", 36)
  If $mrtselectionb = 6
    Run $Iexplore + " http://update.microsoft.com/"
  Else Goto "findmrt"
  EndIf
  Goto "endmrt"

:findmrt
  $mrtexist = Exist ("%SYSTEMROOT%\SYSTEM32\MRT.EXE")
  If $mrtexist = 0 Goto "mrtnotfound"
  Else If $mrtexist = 1 Goto "mrtfound"
  EndIf
Goto "endmrt"

:mrtnotfound
  MessageBox("Microsoft Windows® Malicious Software Removal Tool was NOT found on your system.  The Windows® Update website will now launch so you can update your version of Windows® and obtain the latest version of Microsoft Windows® Malicious Software Removal Tool.", "Launching Windows® Update", 64)
  Run $Iexplore + " http://update.microsoft.com/"
  Goto "endmrt"

:mrtfound
  $runmrtselection = MessageBox("Would you like to run Microsoft Windows® Malicious Software Removal Tool now?", "Run MRT now?", 36)
  If $runmrtselection = 6
    Shell "%SYSTEMROOT%\SYSTEM32\MRT.EXE /F:Y"
  Goto "endmrt"

:endmrt
EndFunction

Function smitrem_Click()
  $SmitRemselection = MessageBox("SmitRem is a tool developed by noahdefear (http://noahdfear.geekstogo.com/) for the sole reason of removing some very difficult to remove spyware.  Some of the more difficult malware it targets is:  Trojan-Spy.HTML.Smitfraud.c, AntivirusGold, PSGuard Spyware Remover, SpySheriff, Spy Trooper, SpyAxe, Security Toolbar, WinHound And SpywareStrike.  This program may make some changes to your desktop.  Would you like to continue to run SmitRem?", "SmitRem", 36)
  If $SmitRemselection = 6 Goto "runsmitrem"
  Else Goto "endsmitrem"

:runsmitrem
  MD "%temp%\smitrem"
  Copy @SCRIPTDIR + "\..\astools\smitrem\*.*" "%temp%\smitrem"/s /h /r
  SetConsole ("SHOW")
  SetConsole ("FOREGROUND")
  SetConsole ("ALWAYSONTOP")
  CLS
  CD "%temp%\smitrem"
  Shell"runthis.bat"
  CD @SCRIPTDIR
  SetConsole ("HIDE")
  Del "%temp%\Smitrem\*.*" /c /f /h /s
  RD "%temp%\smitrem"
  Goto "endsmitrem"

:endsmitrem
  SetConsole ("HIDE")
EndFunction

Function tcprepair_Click()
  $selectiontcp = MessageBox("Some spyware binds to your TCP/IP stack in a manner such that when it is removed from your computer, your Internet connection will no longer work.  This program is designed solely to fix an Internet connection that does not work.  It repairs your Winsock TCP/IP stack back to a normal working state.  This program REQUIRES A REBOOT when it is finished.  Do you wish to continue to run WinSockXPFix?", "Run WinSockXPFix", 36)
  If $selectiontcp = 6 Goto "RunTCPFix"
  Else Goto "endTCPfix"
  EndIf

:RunTCPFix
  Run @SCRIPTDIR + "\..\astools\WinsockXPFix.exe"
  $Form1.Hide
  Quit

:endTCPfix
EndFunction

Function sysclean_Click()
  $runsysclean = MessageBox("Trend Micro SYSCLEAN is a virus cleanup program from Trend Micro that will help you clean up viruses that are already on your computer.  SYSCLEAN is NOT a replacement for a good antivirus tool.  Would you like to start SYSCLEAN now to scan your PC for viruses?", "Run SYSCLEAN now", 36)
  If $runsysclean = 6
  Shell @SCRIPTDIR + "\..\avtools\sysclean\sysclean.exe"
  EndIf
EndFunction

Function vcleaner_Click()
  SetConsole ("SHOW")
  SetConsole ("FOREGROUND")
  SetConsole ("ALWAYSONTOP")
  CLS
  $runvcleaner = MessageBox("Grisoft VCLEANER is a virus cleanup program from Grisoft, the maker of AVG, that will help you clean up viruses that are already on your computer.  VCLEANER is NOT a replacement for a good antivirus tool." + Chr(10) + Chr(10) + "WARNING:  When you run this virus cleaner - you need to let the program completely finish." + Chr(10) + Chr(10) + "Would you like to start VCLEANER now to scan your PC for viruses?", "Run VCLEANER now", 36)
  If $runvcleaner = 6
  Shell @SCRIPTDIR + "\..\avtools\vcleaner.exe"
  Else Goto "endvclean"

:endvclean
SetConsole ("HIDE")
EndFunction

Function stinger_Click()
  $runstinger = MessageBox("McAfee Stinger is a virus cleanup program from McAfee that will help you clean up viruses that are already on your computer.  Stinger is NOT a replacement for a good antivirus tool.  Would you like to start Stinger now to scan your PC for viruses?", "Run Stinger now", 36)
  If $runstinger = 6
  Shell @SCRIPTDIR + "\..\avtools\stng260.exe"
 EndFunction

Function avgfree_Click()
  MessageBox("Grisoft AVG Antivirus Free Edition is a very good free Antivirus Solution for Microsoft Windows and Linux platforms.  AVG ANTIVIRUS FREE EDITION IS NOT AVAILABLE FOR COMMERCIAL USE.  Use of AVG Antivirus Free Edition in a business environment is a violation of the AVG Antivirus License Agreement!  Before installing this program, it is recommended that you view information about AVG Antivirus Free Edition versus AVG Antivirus Professional Edition so you fully understand what you DO NOT GET when you opt for installing AVG Antivirus Free Edition." + Chr(10) + Chr(10) + "There should NEVER be more than one antivirus program installed on a computer at any given time.  If you have an antivirus program already, you need to uninstall it before installing AVG Antivirus."  + Chr(10) + Chr(10) + "Click OK to launch the AVG Antivirus Free Edition Website.", "View AVG information", 64)
  Shell $Iexplore + " http://free.grisoft.com/doc/2/lng/us/tpl/v5"
  $promptavgfreeinstall = MessageBox("You now understand that by installing AVG Antivirus Free Edition you will not receive the following items as part of AVG Antivirus Professional:" + Chr(10) + Chr(10) + "You DO NOT receive -  24/7 Technical Support" + Chr(10) + "You DO NOT receive - Faster updates" + Chr(10) + "You DO NOT receive - Multiple Languages" + Chr(10) + "You DO NOT receive - Detailed customizable settings" + Chr(10) + "You DO NOT receive - Consent for commercial use" + Chr(10) + "You DO NOT receive - The ability to scan for potentially unwanted programs" + Chr(10) + Chr(10) + "There should NEVER be more than one antivirus program installed on a computer at any given time.  If you have an antivirus program already, you need to uninstall it before installing AVG Antivirus."  + Chr(10) + Chr(10) + "Do you understand these limitation and still wish to install AVG Antivirus Free Edition anyhow?", "Continue to install AVG Antivirus Free Edition", 36)
  If $promptavgfreeinstall = 6
      Shell @SCRIPTDIR + "\..\avtools\avg71free_394a763.exe"
  EndIf
EndFunction

Function avgpro_Click()
  $promptavgproinstall = MessageBox("Grisoft AVG Antivirus Professional Edition 7.1 is NOT free software.  In order to install the software, you will be required to type in an installation key during installation.  If you are an existing Gipetto customer that purchased AVG Antivirus 7.1 Professional and you have a valid key, please feel free to continue the installation of AVG Antivirus 7.1 Professional Edition.  If you do not have a valid key, please answer no to the question and call Gipetto Tech to obtain your license key."  + Chr(10) + Chr(10) + "Gipetto Tech is an authroized reseller of Grisoft products.  If you would like to install any Grisoft professional product (AVG Antivirus, AVG Firewall, and ewido AntiSpyware), please call Gipetto Tech at (877) 921-6373 to obtain your license." + Chr(10) + Chr(10) + "There should NEVER be more than one antivirus program installed on a computer at any given time.  If you have an antivirus program already, you need to uninstall it before installing AVG Antivirus.", "Continue to install AVG Antivirus 7.1 Professional", 36)
  If $promptavgproinstall = 6
      Shell @SCRIPTDIR + "\..\avtools\avg71f_395a764.exe"
  EndIf
EndFunction

Function ewidoscan_Click()
  $SelectionEwido = MessageBox("This will launch Internet Explorer to open ewido network's online scanner to scan your computer for malware.  Do you wish to continue?", "ewido networks online scan", 36)
  If $SelectionEwido = 6
      Run $Iexplore + " http://www.ewido.net/en/onlinescan/"
  EndIf
EndFunction

Function tmas_Click()
  $Selectiontmas = MessageBox("This will launch Internet Explorer to open Trend Micro's Anti-Spyware for the Web to scan your computer for malware.  Do you wish to continue?", "Trend Micro Anti-Spyware for the Web", 36)
  If $Selectiontmas = 6
      Run $Iexplore + " http://www.trendmicro.com/spyware-scan/"
  EndIf
EndFunction

Function capestscan_Click()
  $Selectioncapest = MessageBox("This will launch Internet Explorer to open Computer Associates eTrust Pest Scan to scan your computer for malware.  Do you wish to continue?", "Computer Associates eTrust Pest Scan", 36)
  If $Selectioncapest = 6
      Run $Iexplore + " http://www3.ca.com/securityadvisor/pest/pestscan.aspx"
  EndIf
EndFunction

Function tmhousecall_Click()
  $Selectioncapest = MessageBox("This will launch Internet Explorer to open Trend Micro HouseCall to scan your computer for viruses.  Do you wish to continue?", "Trend Micro HouseCall", 36)
  If $Selectioncapest = 6
      Run $Iexplore + " http://www.trendmicro.com/hc_intro/default.asp"
  EndIf
EndFunction

Function caav_Click()
  $Selectioncapest = MessageBox("This will launch Internet Explorer to open Computer Associates eTrust Antivirus Web Scanner to scan your computer for viruses.  Do you wish to continue?", "Computer Associates eTrust Antivirus Web Scanner", 36)
  If $Selectioncapest = 6
      Run $Iexplore + " http://www3.ca.com/securityadvisor/virusinfo/scan.aspx"
  EndIf
EndFunction

Function pandaactivescan_Click()
  $Selectioncapest = MessageBox("This will launch Internet Explorer to open Panda Software Antivirus ActiveScan to scan your computer for viruses.  Do you wish to continue?", "Panda Software ActiveScan", 36)
  If $Selectioncapest = 6
      Run $Iexplore + " http://www.pandasoftware.com/activescan"
  EndIf
EndFunction

Function windowsdefender_Click()
  If @PRODUCTTYPE = "Windows 95" Goto "defendernotsupported"
  Else If @PRODUCTTYPE = "Windows 98" Goto "defendernotsupported"
  Else If @PRODUCTTYPE = "Windows Me" Goto "defendernotsupported"
  Else If @PRODUCTTYPE = "Windows NT Workstation" Goto "defendernotsupported"
  Else If @PRODUCTTYPE = "Windows NT Server" Goto "defendernotsupported"
  Else If @PRODUCTTYPE = "Windows NT Domain Controller" Goto "defendernotsupported"
  Else If @PRODUCTTYPE = "Windows 2000 Professional" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows 2000 Server" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows 2000 Domain Controller" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows XP Home Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows XP Professional" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows XP Professional Tablet PC" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows XP Media Center Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows XP Starter Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Starter Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Server 2003" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Server 2003 Domain Controller" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Server 2003 R2" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Server 2003 R2 Domain Controller" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Home Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Professional" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Professional Tablet PC" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Media Center Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Starter Edition" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Server" Goto "defendersupported"
  Else If @PRODUCTTYPE = "Windows Vista Domain Controller" Goto "defendersupported"
  Else Goto "enddefender"

:defendernotsupported
  $Selectiondefendera = MessageBox("Windows® Defender will not run on your current operating system (" + @PRODUCTTYPE + ").  Do you still wish to launch the Windows® Defender homepage so you can read about Windows® Defender?", "Launch Windows® Defender homepage", 36) 
  If $Selectiondefendera = 6
    Run $Iexplore + " http://www.microsoft.com/athome/security/spyware/software/default.mspx"
  EndIf
Goto "enddefender"

:defendersupported
  $Selectiondefenderb = MessageBox("To properly run Windows® Defender, your PC must be at Windows® 2000 SP4 or Windows® XP SP2 or higher.  You currently have " + @PRODUCTTYPE + " with " + @CSD + ".  The latest version of Windows® Genuine Advantage (available through Windows® Update) must be installed as well.  If you continue, Internet Explorer will launch to the Windows® Defender homepage so you can read about and/or download Windows® Defender.  Do you wish to continue?", "Launch Windows® Defender homepage", 36) 
  If $Selectiondefenderb = 6
    Run $Iexplore + " http://www.microsoft.com/athome/security/spyware/software/default.mspx"
  EndIf
Goto "enddefender"

:enddefender
EndFunction

Function adawarehome_Click()
  Run $Iexplore + " http://www.lavasoftusa.com/"
EndFunction

Function spybothome_Click()
  Run $Iexplore + " http://www.safer-networking.org/en/index.html"
EndFunction

Function spywareblasterhome_Click()
  Run $Iexplore + " http://www.javacoolsoftware.com/spywareblaster.html"
EndFunction

Function ewidohome_Click()
  Run $Iexplore + " http://www.ewido.net/"
EndFunction

Function grisofthome_Click()
  Run $Iexplore + " http://www.grisoft.com/"
EndFunction

Function glive_Click()
  $Selectioncapest = MessageBox("This will launch the installation program to install Gipetto Live to your computer.  This software will do absolutely nothing for you without first calling Gipetto Tech at (877) 921-6373 to speak to a support professional.  Do you wish to continue?", "Installing Gipetto Live!", 36)
  If $Selectioncapest = 6
      Shell @SCRIPTDIR + "\..\glive\setup.exe"
  EndIf
EndFunction

Function exit_Click()
  Quit
EndFunction
Back to top
View user's profile Send private message Visit poster's website
Gargoyle
KiXforms Aficionado
KiXforms Aficionado


Joined: 30 Dec 2003
Posts: 366
Location: Arizona

PostPosted: Mon Jul 03, 2006 9:26 pm    Post subject: Reply with quote

Ok here is some stuff that you can do to clean up your code and maybe give you an idea on how to use functions instead of "GOTO".

I only did part of it and will leave the rest up to you to ask questions on.

I have removed unchanged sections so that it is shorter ....

Code:

Break On
SetConsole ("HIDE")

  $netframeworkinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 1.1  (1033)")
  If $netframeworkinstalled = "1"  checkos()
  Else  installnetframework()
  EndIf

$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

-------------SNIP-------------------------
Code:

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0

Function installnetframework ()
  Shell @SCRIPTDIR + "\..\REDIST\dotnetfx.exe /q"
EndFunction

Function checkos ()
  If @INWIN = "2" regassembly9x()
  Else If @INWIN = "1" regassemblynt()
  EndIf
EndFunction

Function regassemblynt()
  Copy @SCRIPTDIR + "\Kixforms.System.dll" "%SystemRoot%\system32" /r
  Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%SystemRoot%\system32" /r
  Shell "%SystemRoot%\Microsoft.NET\Framework\v1.1.4322\regasm.exe %SystemRoot%\system32\Kixforms.System.dll /tlb /codebase /silent"
EndFunction

Function regassembly9x ()
  Copy @SCRIPTDIR + "\Kixforms.System.dll" "%WinDir%\system" /r
  Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%WinDir%\system" /r
  Shell "%WinDir%\Microsoft.NET\Framework\V1.1.4322\regasm.exe %windir%\system\Kixforms.System.dll /tlb /codebase /silent"
EndFunction


Function adaware_Click()
  $adawareinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal")
  If $adawareinstalled = "1" chkaawversion ()
  Else installaaw ()
  EndIf
EndFunction
 
Function chkaawversion ()
  $aawversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal","DisplayVersion")
  If $aawversion = "1.06" aawdefsupdate ()
  Else installaaw ()
  EndIf
EndFunction

Function aawdefsupdate ()
  $adawarekey = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal","DisplayIcon")
  $aawlocation = Left($adawarekey, Len($adawarekey)-3)
  $adawarefolder = Left($aawlocation, Len($aawlocation)-13)
  $aawrefs = CompareFileTimes($adawarefolder + "\defs.ref", @SCRIPTDIR + "\..\astools\defs.ref")
  If $aawrefs = -1 aawupdate()
  Else runaaw106()
  EndIf
EndFunction

Function aawupdate ()
  Copy @SCRIPTDIR + "\..\astools\defs.ref" $adawarefolder /r
  aawdefsupdate ()
EndFunction

Function runaaw106 ()
  Shell Chr(34) + $aawlocation + Chr(34)
  endaaw()
EndFunction

Function installaaw ()
 $Selectioncapest = MessageBox("Ad-Aware SE 1.06 was not found on your computer.  Would you like to continue to install Lavasoft Ad-Aware?", "Installing Ad-Aware SE 1.06", 36)
  If $Selectioncapest = 6
      Shell @SCRIPTDIR + "\..\astools\aawsepersonal.exe"
  EndIf
  endaaw()
EndFunction

Function endaaw ()
$btnaawcolor = $System.Color.FromName("Khaki")
$btnaawtext ="Ad-Aware SE Personal 1.06"
EndFunction


Function spybot_Click()
  $spybotinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1")
  If $spybotinstalled = "1" chkspybotversion ()
  Else Goto "installspybot"
  EndIf
EndFunction

Function chkspybotversion ()
  $spybotversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","DisplayVersion")
  $spybotprogram = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","DisplayIcon")
  $spybotfolder = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","InstallLocation")
  If $spybotversion = "1.4" runspybot14
  Else removespybot ()
  EndIf
EndFunction

Function removespybot
  $spybotremove = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","UninstallString")
  $Selectionspyremove = MessageBox("Spybot Search & Destroy was found on your computer, but it is NOT version 1.4.  Would you like to remove Spybot Search & Destroy now (this is required in order to get version 1.4 to install properly)?", "Remove previous version of Spybot", 36)
  If $Selectionspyremove = 6 uninstallspybot ()
  Else endspybot ()
  EndIf
EndFunction

Function uninstallspybot ()
   Run $spybotremove
   $Form1.Hide
   Quit
  endspybot ()
EndFunction

Function runspybot14 
  ;MessageBox ("Please be patient, Spybot Search & Destroy may take a few minutes to start.  We are running an automatic update process that happens in the backgroung.  Spybot will start automatically once the automatic update is done.  Please click Ok to continue with the automatic update process.", "Please be patient!", 64)
  Shell Chr(34) + $spybotprogram + Chr(34) + " /autoupdate /autoclose"
  Shell Chr(34) + $spybotprogram + Chr(34) + " /allhives"
 endspybot ()
EndFunction

Function installspybot ()
 $Selectioninstsb = MessageBox("Spybot Search & Destroy 1.4 was not found on your computer.  Would you like to continue to install Spybot?", "Installing Spybot Search & Destroy 1.4", 36)
  If $Selectioninstsb = 6
      Shell @SCRIPTDIR + "\..\astools\spybotsd14.exe"
    ;Shell @SCRIPTDIR + "\..\astools\spybotsd_advcheck.exe"
    ;Shell @SCRIPTDIR + "\..\astools\spybotsd_tools.exe"
    ;Shell @SCRIPTDIR + "\..\astools\spybotsd_includes.exe"
  EndIf
 endspybot ()
EndFunction

Function endspybot ()
;Change buttons here
EndFunction

_________________
Parents were invented to make children happy by giving them something to ignore.
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Mon Jul 03, 2006 10:48 pm    Post subject: Reply with quote

Ok, I have re-worked your script to remove the 'GoTo' statements, and found several missing 'Endif' statements. I don't think it would have run correctly, I fixed these and have added a couple lines, you will find these lines in the 'installaaw()' Function:

Code:

$btnadaware.BackColor = $System.Color.FromName("Red")
$btnadaware.Text = "Install Ad-Aware SE Personal"


here is your re-worked code, tell me if this is what you are looking for:

Code:

Break On
SetConsole ("HIDE")

Is_netframeworkinstalled()

$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf
$nul = $System.Application.EnableVisualStyles

SplashForm()

;region Main Form
$Form1 = $System.Form()
$Form1.BackColor = $System.Color.FromName("YellowGreen")
$Form1.FormBorderStyle = 1  ;FormBorderStyle_FixedSingle
$Form1.MaximizeBox = 0  ;False
$Form1.MinimizeBox = 0  ;False
$Form1.StartPosition = 1  ;FormStartPosition_CenterScreen
$Form1.Size = $System.Size(507,453) ;(Width,Height)
$Form1.Text = "Gipetto Cleanup CD"
$Form1.Icon = $GTIcon

$TabControl1 = $System.TabControl()
$TabControl1.Height = 404
$TabControl1.Left = 8
$TabControl1.TabStop = -1  ;True
$TabControl1.Top = 9
$TabControl1.Width = 482
$nul = $Form1.Controls.Add($TabControl1)

$TabControl1TabPage1 = $System.TabPage()
$TabControl1TabPage1.BackColor = $System.Color.FromName("White")
$TabControl1TabPage1.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage1.Text = "Spyware Removal Tools"
$nul = $TabControl1.Controls.Add($TabControl1TabPage1)

$btnadaware = $System.Button()
$btnadaware.BackColor = $System.Color.FromName("Khaki")
$btnadaware.Left = 152
$btnadaware.TabStop = -1  ;True
$btnadaware.Text = "Ad-Aware SE Personal - 1.06"
$btnadaware.Top = 100
$btnadaware.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnadaware)

$btnspybot = $System.Button()
$btnspybot.BackColor = $System.Color.FromName("Khaki")
$btnspybot.Left = 152
$btnspybot.TabStop = -1  ;True
$btnspybot.Text = "Spybot Search && Destroy - 1.4"
$btnspybot.Top = 135
$btnspybot.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnspybot)

$btnsblaster = $System.Button()
$btnsblaster.BackColor = $System.Color.FromName("Khaki")
$btnsblaster.Left = 152
$btnsblaster.TabStop = -1  ;True
$btnsblaster.Text = "Spyware Blaster - 3.5.1"
$btnsblaster.Top = 170
$btnsblaster.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnsblaster)

$btnmrt = $System.Button()
$btnmrt.BackColor = $System.Color.FromName("Khaki")
$btnmrt.Left = 152
$btnmrt.TabStop = -1  ;True
$btnmrt.Text = "Microsoft Windows® MRT"
$btnmrt.Top = 205
$btnmrt.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnmrt)

$btnsmitrem = $System.Button()
$btnsmitrem.BackColor = $System.Color.FromName("Khaki")
$btnsmitrem.Left = 152
$btnsmitrem.TabStop = -1  ;True
$btnsmitrem.Text = "SmitRem - 2.8"
$btnsmitrem.Top = 240
$btnsmitrem.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btnsmitrem)

$btnexit1 = $System.Button()
$btnexit1.BackColor = $System.Color.FromName("YellowGreen")
$btnexit1.Left = 343
$btnexit1.Text = "E&xit Program"
$btnexit1.Top = 347
$btnexit1.Width = 123
$nul = $TabControl1TabPage1.Controls.Add($btnexit1)

$PictureBox1 = $System.PictureBox()
$PictureBox1.Height = 67
$PictureBox1.Left = 221
$PictureBox1.Top = 8
$PictureBox1.Width = 245
$nul = $TabControl1TabPage1.Controls.Add($PictureBox1)

$PictureBox1.Image = $GTLogo

$btntcprepair = $System.Button()
$btntcprepair.BackColor = $System.Color.FromName("Khaki")
$btntcprepair.Left = 152
$btntcprepair.TabStop = -1  ;True
$btntcprepair.Text = "TCP/IP Stack Repair"
$btntcprepair.Top = 275
$btntcprepair.Width = 166
$nul = $TabControl1TabPage1.Controls.Add($btntcprepair)

$Label2 = $System.Label()
$Label2.BackColor = $System.Color.FromName("Transparent")
$Label2.Left = 1
$Label2.Text = "ver 1.0 - 07/2006"
$Label2.TextAlign = 16  ;MiddleLeft
$Label2.Top = 354
$nul = $TabControl1TabPage1.Controls.Add($Label2)

$TabControl1TabPage3 = $System.TabPage()
$TabControl1TabPage3.BackColor = $System.Color.FromName("White")
$TabControl1TabPage3.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage3.Text = "Antivirus Tools"
$nul = $TabControl1.Controls.Add($TabControl1TabPage3)

$Label3 = $System.Label()
$Label3.BackColor = $System.Color.FromName("Transparent")
$Label3.Left = 1
$Label3.Text = "ver 1.0 - 07/2006"
$Label3.TextAlign = 16  ;MiddleLeft
$Label3.Top = 354
$nul = $TabControl1TabPage3.Controls.Add($Label3)

$PictureBox3 = $System.PictureBox()
$PictureBox3.BackColor = $System.Color.FromName("Transparent")
$PictureBox3.Height = 67
$PictureBox3.Left = 221
$PictureBox3.Top = 8
$PictureBox3.Width = 245
$nul = $TabControl1TabPage3.Controls.Add($PictureBox3)

$PictureBox3.Image = $GTLogo

$btnexit2 = $System.Button()
$btnexit2.BackColor = $System.Color.FromName("YellowGreen")
$btnexit2.Left = 343
$btnexit2.Text = "E&xit Program"
$btnexit2.Top = 347
$btnexit2.Width = 123
$nul = $TabControl1TabPage3.Controls.Add($btnexit2)

$btnsysclean = $System.Button()
$btnsysclean.BackColor = $System.Color.FromName("Khaki")
$btnsysclean.Left = 152
$btnsysclean.TabStop = -1  ;True
$btnsysclean.Text = "Trend Micro SYSCLEAN"
$btnsysclean.Top = 100
$btnsysclean.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnsysclean)

$btnvcleaner = $System.Button()
$btnvcleaner.BackColor = $System.Color.FromName("Khaki")
$btnvcleaner.Left = 152
$btnvcleaner.TabStop = -1  ;True
$btnvcleaner.Text = "AVG Vcleaner"
$btnvcleaner.Top = 135
$btnvcleaner.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnvcleaner)

$btnstinger = $System.Button()
$btnstinger.BackColor = $System.Color.FromName("Khaki")
$btnstinger.Left = 152
$btnstinger.TabStop = -1  ;True
$btnstinger.Text = "McAfee Stinger"
$btnstinger.Top = 170
$btnstinger.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnstinger)

$btnavgfree = $System.Button()
$btnavgfree.BackColor = $System.Color.FromName("Khaki")
$btnavgfree.Left = 152
$btnavgfree.TabStop = -1  ;True
$btnavgfree.Text = "AVG Antivirus Free Edition"
$btnavgfree.Top = 205
$btnavgfree.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnavgfree)

$btnavgpro = $System.Button()
$btnavgpro.BackColor = $System.Color.FromName("Khaki")
$btnavgpro.Left = 152
$btnavgpro.TabStop = -1  ;True
$btnavgpro.Text = "AVG Antivirus Professional"
$btnavgpro.Top = 240
$btnavgpro.Width = 166
$nul = $TabControl1TabPage3.Controls.Add($btnavgpro)

$TabControl1TabPage4 = $System.TabPage()
$TabControl1TabPage4.BackColor = $System.Color.FromName("White")
$TabControl1TabPage4.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage4.Text = "Web Links"
$nul = $TabControl1.Controls.Add($TabControl1TabPage4)

$btnexit3 = $System.Button()
$btnexit3.BackColor = $System.Color.FromName("YellowGreen")
$btnexit3.Left = 343
$btnexit3.Text = "E&xit Program"
$btnexit3.Top = 347
$btnexit3.Width = 123
$nul = $TabControl1TabPage4.Controls.Add($btnexit3)

$Label4 = $System.Label()
$Label4.BackColor = $System.Color.FromName("Transparent")
$Label4.Left = 1
$Label4.Text = "ver 1.0 - 07/2006"
$Label4.TextAlign = 16  ;MiddleLeft
$Label4.Top = 354
$nul = $TabControl1TabPage4.Controls.Add($Label4)

$PictureBox4 = $System.PictureBox()
$PictureBox4.BackColor = $System.Color.FromName("Transparent")
$PictureBox4.Height = 67
$PictureBox4.Left = 221
$PictureBox4.Top = 8
$PictureBox4.Width = 245
$nul = $TabControl1TabPage4.Controls.Add($PictureBox4)

$PictureBox4.Image = $GTLogo

$btnewidoscan = $System.Button()
$btnewidoscan.BackColor = $System.Color.FromName("Khaki")
$btnewidoscan.Left = 46
$btnewidoscan.TabStop = -1  ;True
$btnewidoscan.Text = "ewido networks Online Scan"
$btnewidoscan.Top = 100
$btnewidoscan.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnewidoscan)

$btntmantispyware = $System.Button()
$btntmantispyware.BackColor = $System.Color.FromName("Khaki")
$btntmantispyware.Left = 46
$btntmantispyware.TabStop = -1  ;True
$btntmantispyware.Text = "Trend Micro Anti-Spyware"
$btntmantispyware.Top = 135
$btntmantispyware.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btntmantispyware)

$btncapestscan = $System.Button()
$btncapestscan.BackColor = $System.Color.FromName("Khaki")
$btncapestscan.Left = 46
$btncapestscan.TabStop = -1  ;True
$btncapestscan.Text = "CA eTrust PestScan"
$btncapestscan.Top = 170
$btncapestscan.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btncapestscan)

$btntmhousecall = $System.Button()
$btntmhousecall.BackColor = $System.Color.FromName("Khaki")
$btntmhousecall.Left = 46
$btntmhousecall.TabStop = -1  ;True
$btntmhousecall.Text = "Trend Micro HouseCall"
$btntmhousecall.Top = 205
$btntmhousecall.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btntmhousecall)

$btncaantivirus = $System.Button()
$btncaantivirus.BackColor = $System.Color.FromName("Khaki")
$btncaantivirus.Left = 46
$btncaantivirus.TabStop = -1  ;True
$btncaantivirus.Text = "CA eTrust Antivirus Web Scan"
$btncaantivirus.Top = 240
$btncaantivirus.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btncaantivirus)

$btnpandaactivescan = $System.Button()
$btnpandaactivescan.BackColor = $System.Color.FromName("Khaki")
$btnpandaactivescan.Left = 46
$btnpandaactivescan.TabStop = -1  ;True
$btnpandaactivescan.Text = "Panda Software ActiveScan"
$btnpandaactivescan.Top = 275
$btnpandaactivescan.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnpandaactivescan)

$btnwindowsdefenderhome = $System.Button()
$btnwindowsdefenderhome.BackColor = $System.Color.FromName("Khaki")
$btnwindowsdefenderhome.Left = 258
$btnwindowsdefenderhome.TabStop = -1  ;True
$btnwindowsdefenderhome.Text = "Microsoft Windows® Defender"
$btnwindowsdefenderhome.Top = 100
$btnwindowsdefenderhome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnwindowsdefenderhome)

$btnadawarehome = $System.Button()
$btnadawarehome.BackColor = $System.Color.FromName("Khaki")
$btnadawarehome.Left = 258
$btnadawarehome.TabStop = -1  ;True
$btnadawarehome.Text = "Lavasoft Ad-Aware Homepage"
$btnadawarehome.Top = 135
$btnadawarehome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnadawarehome)

$btnspybothome = $System.Button()
$btnspybothome.BackColor = $System.Color.FromName("Khaki")
$btnspybothome.Left = 258
$btnspybothome.TabStop = -1  ;True
$btnspybothome.Text = "Spybot S&&D Homepage"
$btnspybothome.Top = 170
$btnspybothome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnspybothome)

$btnspywareblasterhome = $System.Button()
$btnspywareblasterhome.BackColor = $System.Color.FromName("Khaki")
$btnspywareblasterhome.Left = 258
$btnspywareblasterhome.TabStop = -1  ;True
$btnspywareblasterhome.Text = "Spyware Blaster Homepage"
$btnspywareblasterhome.Top = 205
$btnspywareblasterhome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnspywareblasterhome)

$btnewidohome = $System.Button()
$btnewidohome.BackColor = $System.Color.FromName("Khaki")
$btnewidohome.Left = 258
$btnewidohome.TabStop = -1  ;True
$btnewidohome.Text = "ewido networks Homepage"
$btnewidohome.Top = 240
$btnewidohome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btnewidohome)

$btngrisofthome = $System.Button()
$btngrisofthome.BackColor = $System.Color.FromName("Khaki")
$btngrisofthome.Left = 258
$btngrisofthome.TabStop = -1  ;True
$btngrisofthome.Text = "Grisoft AVG Homepage"
$btngrisofthome.Top = 275
$btngrisofthome.Width = 166
$nul = $TabControl1TabPage4.Controls.Add($btngrisofthome)

$TabControl1TabPage5 = $System.TabPage()
$TabControl1TabPage5.BackColor = $System.Color.FromName("White")
$TabControl1TabPage5.BorderStyle = 2  ;Fixed3D
$TabControl1TabPage5.Text = "Gipetto Live!"
$nul = $TabControl1.Controls.Add($TabControl1TabPage5)

$Label5 = $System.Label()
$Label5.BackColor = $System.Color.FromName("Transparent")
$Label5.Left = 1
$Label5.Text = "ver 1.0 - 07/2006"
$Label5.TextAlign = 16  ;MiddleLeft
$Label5.Top = 354
$nul = $TabControl1TabPage5.Controls.Add($Label5)

$PictureBox5 = $System.PictureBox()
$PictureBox5.BackColor = $System.Color.FromName("Transparent")
$PictureBox5.Height = 67
$PictureBox5.Left = 221
$PictureBox5.Top = 8
$PictureBox5.Width = 245
$nul = $TabControl1TabPage5.Controls.Add($PictureBox5)

$PictureBox5.Image = $GTLogo

$btnexit4 = $System.Button()
$btnexit4.BackColor = $System.Color.FromName("YellowGreen")
$btnexit4.Left = 343
$btnexit4.Text = "E&xit Program"
$btnexit4.Top = 347
$btnexit4.Width = 123
$nul = $TabControl1TabPage5.Controls.Add($btnexit4)

$installglive = $System.Button()
$installglive.BackColor = $System.Color.FromName("Khaki")
$installglive.Left = 152
$installglive.Text = "Install Gipetto Live"
$installglive.Top = 240
$installglive.Width = 166
$nul = $TabControl1TabPage5.Controls.Add($installglive)

$Label2 = $System.Label()
$Label2.Height = 132
$Label2.Left = 152
$Label2.Text = "Gipetto Live is a remote support program that will allow a Gipetto Support Professional to take control of your computer as if we were sitting directly in front of it.  This service is not free and will not work for you without first calling Gipetto Tech - (877) 921-6373."
$Label2.TextAlign = 16  ;MiddleLeft
$Label2.Top = 100
$Label2.Width = 166
$nul = $TabControl1TabPage5.Controls.Add($Label2)

$AboutCD = $System.TabPage()
$AboutCD.BackColor = $System.Color.FromName("White")
$AboutCD.BorderStyle = 2  ;Fixed3D
$AboutCD.Text = "About"
$nul = $TabControl1.Controls.Add($AboutCD)

$Label6 = $System.Label()
$Label6.BackColor = $System.Color.FromName("Transparent")
$Label6.Left = 1
$Label6.Text = "ver 1.0 - 07/2006"
$Label6.TextAlign = 16  ;MiddleLeft
$Label6.Top = 354
$nul = $AboutCD.Controls.Add($Label6)

$PictureBox6 = $System.PictureBox()
$PictureBox6.BackColor = $System.Color.FromName("Transparent")
$PictureBox6.Height = 67
$PictureBox6.Left = 221
$PictureBox6.Top = 8
$PictureBox6.Width = 245
$nul = $AboutCD.Controls.Add($PictureBox6)

$PictureBox6.Image = $GTLogo

$btnexit5 = $System.Button()
$btnexit5.BackColor = $System.Color.FromName("YellowGreen")
$btnexit5.Left = 343
$btnexit5.Text = "E&xit Program"
$btnexit5.Top = 347
$btnexit5.Width = 123
$nul = $AboutCD.Controls.Add($btnexit5)

$Label1 = $System.Label()
$Label1.Height = 198
$Label1.Left = 46
$Label1.Text = "Gipetto Tech services and repairs most brands, makes and models of computers. With our trained professional team we offer a high level of quality service . Forget about unplugging and hauling your computer around town, trying to find someone to fix it in a timely manner. Remember, we fix your computer in your home or office and we do it when you schedule the service. Concerned about " + Chr(34) + "tech jargon" + Chr(34) + "? Our Gipetto Techs are trained to discuss your situation in " + Chr(34) + "simple English" + Chr(34) + "." + Chr(10) + Chr(10) +"If you just bought that Dell, Compaq, Gateway or unbranded computer and you need some help, call us. We are experts in setting up the computer the way you want." + Chr(10) + Chr(10) + "Gipetto Tech phone number:  (877) 921-6373" + Chr(10) + "Gipetto Tech website:  http://www.gipetto.com/"
$Label1.TextAlign = 16  ;MiddleLeft
$Label1.Top = 100
$Label1.Width = 378
$nul = $AboutCD.Controls.Add($Label1)

$btnadaware.Click = "adaware_Click()"
$btnspybot.Click = "spybot_Click()"
$btnsblaster.Click = "spyblaster_Click()"
$btnmrt.Click = "mrt_Click()"
$btnsmitrem.Click = "smitrem_Click()"
$btntcprepair.Click = "tcprepair_Click()"
$btnsysclean.Click = "sysclean_Click()"
$btnvcleaner.Click = "vcleaner_Click()"
$btnstinger.Click = "stinger_Click()"
$btnavgfree.Click = "avgfree_Click()"
$btnavgpro.Click = "avgpro_Click()"
$btnewidoscan.Click = "ewidoscan_Click()"
$btntmantispyware.Click = "tmas_Click()"
$btncapestscan.Click = "capestscan_Click()"
$btntmhousecall.Click = "tmhousecall_Click()"
$btncaantivirus.Click = "caav_Click()"
$btnpandaactivescan.Click = "pandaactivescan_Click()"
$btnwindowsdefenderhome.Click = "windowsdefender_Click()"
$btnadawarehome.Click = "adawarehome_Click()"
$btnspybothome.Click = "spybothome_Click()"
$btnspywareblasterhome.Click = "spywareblasterhome_Click()"
$btnewidohome.Click = "ewidohome_Click()"
$btngrisofthome.Click = "grisofthome_Click()"
$installglive.Click = "glive_Click()"
$btnexit1.Click = "exit_Click()"
$btnexit2.Click = "exit_Click()"
$btnexit3.Click = "exit_Click()"
$btnexit4.Click = "exit_Click()"
$btnexit5.Click = "exit_Click()"

$Form1.Center
$Form1.Show  ;Displays the Form

While $Form1.Visible
   $Nul = Execute($Form1.DoEvents())
Loop
Exit 0
;endregion

Function Is_netframeworkinstalled()
   $netframeworkinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 1.1  (1033)")
   If $netframeworkinstalled = "1"
      If @INWIN = "2"
         Copy @SCRIPTDIR + "\Kixforms.System.dll" "%WinDir%\system" /r
         Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%WinDir%\system" /r
         Shell "%WinDir%\Microsoft.NET\Framework\V1.1.4322\regasm.exe %windir%\system\Kixforms.System.dll /tlb /codebase /silent"
      EndIf
      If @INWIN = "1"
         Copy @SCRIPTDIR + "\Kixforms.System.dll" "%SystemRoot%\system32" /r
         Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%SystemRoot%\system32" /r
         Shell "%SystemRoot%\Microsoft.NET\Framework\v1.1.4322\regasm.exe %SystemRoot%\system32\Kixforms.System.dll /tlb /codebase /silent"
      EndIf
   Else
      Shell @SCRIPTDIR + "\..\REDIST\dotnetfx.exe /q"
      Is_netframeworkinstalled()
   EndIf
EndFunction

Function SplashForm()
   $FormSplash = $System.Form()
   $FormSplash.ControlBox = 0  ;True
   $FormSplash.FormBorderStyle = 3  ;FormBorderStyle_FixedDialog
   $FormSplash.MaximizeBox = 0  ;False
   $FormSplash.MinimizeBox = 0  ;False
   $FormSplash.StartPosition = 1  ;FormStartPosition_Center
   $FormSplash.Size = $System.Size(600,195) ;(Width,Height)
   $FormSplash.Text = "Gipetto Tech - We Get The Bugs Out!"
   
   $PictureBoxSplash = $System.PictureBox()
   $PictureBoxSplash.BorderStyle = 1  ;FixedSingle
   $PictureBoxSplash.Height = 195
   $PictureBoxSplash.Left = 0
   $PictureBoxSplash.Top = 0
   $PictureBoxSplash.Width = 600
   $nul = $FormSplash.Controls.Add($PictureBoxSplash)
   
   $PictureBoxSplash.Image = $System.Bitmap(@SCRIPTDIR + "\splash.jpg")
   $Iexplore = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE","")
   $GTIcon = $System.Icon.FromFile(@SCRIPTDIR + "\gipey.ico")
   $GTLogo = $System.Bitmap(@SCRIPTDIR + "\gtlogo.bmp")
   $GTIntro = @SCRIPTDIR + "\bugsout.wav"
   $GTCommercial = @SCRIPTDIR + "commercial.wav"
   
   $FormSplash.Show  ;Displays the Form
   Play File $GTIntro
   $FormSplash.Activate
   ;$FormSplash.Hide ;Hides the Form
   $FormSplash.Close ;Closes the Form
   
   While $FormSplash.Visible
      $Nul = Execute($FormSplash.DoEvents())
   Loop
EndFunction

Function adaware_Click()
   $adawareinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal")
   If $adawareinstalled = "1"
      $aawversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal","DisplayVersion")
      If $aawversion = "1.06"
         aawdefsupdate()
      Else
         installaaw()
      EndIf
   Else
      installaaw()
   EndIf
EndFunction

Function aawdefsupdate()
   $adawarekey = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Ad-Aware SE Personal","DisplayIcon")
   $aawlocation = Left($adawarekey, Len($adawarekey)-3)
   $adawarefolder = Left($aawlocation, Len($aawlocation)-13)
   $aawrefs = CompareFileTimes($adawarefolder + "\defs.ref", @SCRIPTDIR + "\..\astools\defs.ref")
   If $aawrefs = -1
      Copy @SCRIPTDIR + "\..\astools\defs.ref" $adawarefolder /r
      aawdefsupdate()
   Else
      Shell Chr(34) + $aawlocation + Chr(34)
   EndIf
EndFunction

Function installaaw()
   $btnadaware.BackColor = $System.Color.FromName("Red")
   $btnadaware.Text = "Install Ad-Aware SE Personal"
   $Selectioncapest = MessageBox("Ad-Aware SE 1.06 was not found on your computer.  Would you like to continue to install Lavasoft Ad-Aware?", "Installing Ad-Aware SE 1.06", 36)
   If $Selectioncapest = 6
      Shell @SCRIPTDIR + "\..\astools\aawsepersonal.exe"
      $btnadaware.BackColor = $System.Color.FromName("Khaki")
      $btnadaware.Text = "Ad-Aware SE Personal - 1.06"
   EndIf
EndFunction

Function spybot_Click()
   $spybotinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1")
   If $spybotinstalled = "1"
      $spybotversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","DisplayVersion")
      $spybotprogram = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","DisplayIcon")
      $spybotfolder = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","InstallLocation")
      If $spybotversion = "1.4"
         ;MessageBox ("Please be patient, Spybot Search & Destroy may take a few minutes to start.  We are running an automatic update process that happens in the backgroung.  Spybot will start automatically once the automatic update is done.  Please click Ok to continue with the automatic update process.", "Please be patient!", 64)
         Shell Chr(34) + $spybotprogram + Chr(34) + " /autoupdate /autoclose"
         Shell Chr(34) + $spybotprogram + Chr(34) + " /allhives"
      Else
         $spybotremove = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Spybot - Search & Destroy_is1","UninstallString")
         $Selectionspyremove = MessageBox("Spybot Search & Destroy was found on your computer, but it is NOT version 1.4.  Would you like to remove Spybot Search & Destroy now (this is required in order to get version 1.4 to install properly)?", "Remove previous version of Spybot", 36)
         If $Selectionspyremove = 6
            Run $spybotremove
            $Form1.Hide
            Quit
         EndIf
      EndIf
   Else
      $Selectioninstsb = MessageBox("Spybot Search & Destroy 1.4 was not found on your computer.  Would you like to continue to install Spybot?", "Installing Spybot Search & Destroy 1.4", 36)
      If $Selectioninstsb = 6
         Shell @SCRIPTDIR + "\..\astools\spybotsd14.exe"
         ;Shell @SCRIPTDIR + "\..\astools\spybotsd_advcheck.exe"
         ;Shell @SCRIPTDIR + "\..\astools\spybotsd_tools.exe"
         ;Shell @SCRIPTDIR + "\..\astools\spybotsd_includes.exe"
      EndIf
   EndIf
EndFunction

Function spyblaster_Click()
   $sblasterinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1")
   If $sblasterinstalled = 1
      $sblasterversion = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","DisplayVersion")
      $sblasterprogram = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","DisplayIcon")
      $sblasterfolder = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","InstallLocation")
      If $sblasterversion = "3.5.1"
         Shell Chr(34) + $sblasterprogram + Chr(34)
      Else
         $sblasterremove = ReadValue ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\SpywareBlaster_is1","UninstallString")
         $Selectionspyremove = MessageBox("Spyware Blaster was found on your computer, but it is NOT version 3.5.1.  Would you like to remove Spyware Blaster now (this is required in order to get version 3.5.1 to install properly)?", "Remove previous version of Spyware Blaster", 36)
         If $Selectionspyremove = 6
            Shell $sblasterremove
         EndIf
      EndIf
   Else
      $Selectioninstsb = MessageBox("Spyware Blaster 3.5.1 was not found on your computer.  Would you like to continue to install it now?", "Installing Spyware Blaster 3.5.1", 36)
      If $Selectioninstsb = 6
         Shell @SCRIPTDIR + "\..\astools\spywareblastersetup351.exe"
      EndIf
   EndIf
EndFunction

Function mrt_Click()
   If @PRODUCTTYPE = "Windows 95" Or
      @PRODUCTTYPE = "Windows 98" Or
      @PRODUCTTYPE = "Windows Me" Or
      @PRODUCTTYPE = "Windows NT Workstation" Or
      @PRODUCTTYPE = "Windows NT Server" Or
      @PRODUCTTYPE = "Windows NT Domain Controller"
      $mrtselectiona = MessageBox("Malicious Software Removal Tool will not run on your current operating system (" + @PRODUCTTYPE + ").  Do you still wish to launch the Malicious Software Removal Tool homepage so you can read about Malicious Software Removal Tool?", "Launch Malicious Software Removal Tool homepage", 36) 
      If $mrtselectiona = 6
         Run $Iexplore + " http://www.microsoft.com/security/malwareremove/default.mspx"
      EndIf
   EndIf
   If @PRODUCTTYPE = "Windows 2000 Professional" Or
      @PRODUCTTYPE = "Windows 2000 Server" Or
      @PRODUCTTYPE = "Windows 2000 Domain Controller" Or
      @PRODUCTTYPE = "Windows XP Home Edition" Or
      @PRODUCTTYPE = "Windows XP Professional" Or
      @PRODUCTTYPE = "Windows XP Professional Tablet PC" Or
      @PRODUCTTYPE = "Windows XP Media Center Edition" Or
      @PRODUCTTYPE = "Windows XP Starter Edition" Or
      @PRODUCTTYPE = "Windows Starter Edition" Or
      @PRODUCTTYPE = "Windows Server 2003" Or
      @PRODUCTTYPE = "Windows Server 2003 Domain Controller" Or
      @PRODUCTTYPE = "Windows Server 2003 R2" Or
      @PRODUCTTYPE = "Windows Server 2003 R2 Domain Controller" Or
      @PRODUCTTYPE = "Windows Vista Home Edition" Or
      @PRODUCTTYPE = "Windows Vista Professional" Or
      @PRODUCTTYPE = "Windows Vista Professional Tablet PC" Or
      @PRODUCTTYPE = "Windows Vista Media Center Edition" Or
      @PRODUCTTYPE = "Windows Vista Starter Edition" Or
      @PRODUCTTYPE = "Windows Vista Server" Or
      @PRODUCTTYPE = "Windows Vista Domain Controller"
      $mrtselectionb = MessageBox("Microsoft Windows® Malicious Software Removal Tool is a free tool from Microsoft that comes in from Windows® Update.  Would you like to run Windows® Update now to verify you have the latest version of Microsoft Windows® Malicious Software Removal Tool?" + Chr(10) + Chr(10) + "Clicking yes will launch Windows Update." + Chr(10) + "Clicking no will allow you to launch the program.", "Launch Windows® Update to update MRT?", 36)
      If $mrtselectionb = 6
         Run $Iexplore + " http://update.microsoft.com/"
      Else
         $mrtexist = Exist ("%SYSTEMROOT%\SYSTEM32\MRT.EXE")
         If $mrtexist = 0
            MessageBox("Microsoft Windows® Malicious Software Removal Tool was NOT found on your system.  The Windows® Update website will now launch so you can update your version of Windows® and obtain the latest version of Microsoft Windows® Malicious Software Removal Tool.", "Launching Windows® Update", 64)
            Run $Iexplore + " http://update.microsoft.com/"
         Else
            If $mrtexist = 1
               $runmrtselection = MessageBox("Would you like to run Microsoft Windows® Malicious Software Removal Tool now?", "Run MRT now?", 36)
               If $runmrtselection = 6
                  Shell "%SYSTEMROOT%\SYSTEM32\MRT.EXE /F:Y"
               EndIf
            EndIf
         EndIf
      EndIf
   EndIf
   
EndFunction

Function smitrem_Click()
   $SmitRemselection = MessageBox("SmitRem is a tool developed by noahdefear (http://noahdfear.geekstogo.com/) for the sole reason of removing some very difficult to remove spyware.  Some of the more difficult malware it targets is:  Trojan-Spy.HTML.Smitfraud.c, AntivirusGold, PSGuard Spyware Remover, SpySheriff, Spy Trooper, SpyAxe, Security Toolbar, WinHound And SpywareStrike.  This program may make some changes to your desktop.  Would you like to continue to run SmitRem?", "SmitRem", 36)
   If $SmitRemselection = 6
      MD "%temp%\smitrem"
      Copy @SCRIPTDIR + "\..\astools\smitrem\*.*" "%temp%\smitrem"/s /h /r
      SetConsole ("SHOW")
      SetConsole ("FOREGROUND")
      SetConsole ("ALWAYSONTOP")
      CLS
      CD "%temp%\smitrem"
      Shell"runthis.bat"
      CD @SCRIPTDIR
      SetConsole ("HIDE")
      Del "%temp%\Smitrem\*.*" /c /f /h /s
      RD "%temp%\smitrem"
   EndIf
   SetConsole ("HIDE")
EndFunction

Function tcprepair_Click()
   $selectiontcp = MessageBox("Some spyware binds to your TCP/IP stack in a manner such that when it is removed from your computer, your Internet connection will no longer work.  This program is designed solely to fix an Internet connection that does not work.  It repairs your Winsock TCP/IP stack back to a normal working state.  This program REQUIRES A REBOOT when it is finished.  Do you wish to continue to run WinSockXPFix?", "Run WinSockXPFix", 36)
   If $selectiontcp = 6
      Run @SCRIPTDIR + "\..\astools\WinsockXPFix.exe"
      $Form1.Hide
      Quit
   EndIf
EndFunction

Function sysclean_Click()
   $runsysclean = MessageBox("Trend Micro SYSCLEAN is a virus cleanup program from Trend Micro that will help you clean up viruses that are already on your computer.  SYSCLEAN is NOT a replacement for a good antivirus tool.  Would you like to start SYSCLEAN now to scan your PC for viruses?", "Run SYSCLEAN now", 36)
   If $runsysclean = 6
      Shell @SCRIPTDIR + "\..\avtools\sysclean\sysclean.exe"
   EndIf
EndFunction

Function vcleaner_Click()
   SetConsole ("SHOW")
   SetConsole ("FOREGROUND")
   SetConsole ("ALWAYSONTOP")
   CLS
   $runvcleaner = MessageBox("Grisoft VCLEANER is a virus cleanup program from Grisoft, the maker of AVG, that will help you clean up viruses that are already on your computer.  VCLEANER is NOT a replacement for a good antivirus tool." + Chr(10) + Chr(10) + "WARNING:  When you run this virus cleaner - you need to let the program completely finish." + Chr(10) + Chr(10) + "Would you like to start VCLEANER now to scan your PC for viruses?", "Run VCLEANER now", 36)
   If $runvcleaner = 6
      Shell @SCRIPTDIR + "\..\avtools\vcleaner.exe"
   EndIf
   SetConsole ("HIDE")
EndFunction

Function stinger_Click()
   $runstinger = MessageBox("McAfee Stinger is a virus cleanup program from McAfee that will help you clean up viruses that are already on your computer.  Stinger is NOT a replacement for a good antivirus tool.  Would you like to start Stinger now to scan your PC for viruses?", "Run Stinger now", 36)
   If $runstinger = 6
      Shell @SCRIPTDIR + "\..\avtools\stng260.exe"
   EndIf
 EndFunction

Function avgfree_Click()
   MessageBox("Grisoft AVG Antivirus Free Edition is a very good free Antivirus Solution for Microsoft Windows and Linux platforms.  AVG ANTIVIRUS FREE EDITION IS NOT AVAILABLE FOR COMMERCIAL USE.  Use of AVG Antivirus Free Edition in a business environment is a violation of the AVG Antivirus License Agreement!  Before installing this program, it is recommended that you view information about AVG Antivirus Free Edition versus AVG Antivirus Professional Edition so you fully understand what you DO NOT GET when you opt for installing AVG Antivirus Free Edition." + Chr(10) + Chr(10) + "There should NEVER be more than one antivirus program installed on a computer at any given time.  If you have an antivirus program already, you need to uninstall it before installing AVG Antivirus."  + Chr(10) + Chr(10) + "Click OK to launch the AVG Antivirus Free Edition Website.", "View AVG information", 64)
   Shell $Iexplore + " http://free.grisoft.com/doc/2/lng/us/tpl/v5"
   $promptavgfreeinstall = MessageBox("You now understand that by installing AVG Antivirus Free Edition you will not receive the following items as part of AVG Antivirus Professional:" + Chr(10) + Chr(10) + "You DO NOT receive -  24/7 Technical Support" + Chr(10) + "You DO NOT receive - Faster updates" + Chr(10) + "You DO NOT receive - Multiple Languages" + Chr(10) + "You DO NOT receive - Detailed customizable settings" + Chr(10) + "You DO NOT receive - Consent for commercial use" + Chr(10) + "You DO NOT receive - The ability to scan for potentially unwanted programs" + Chr(10) + Chr(10) + "There should NEVER be more than one antivirus program installed on a computer at any given time.  If you have an antivirus program already, you need to uninstall it before installing AVG Antivirus."  + Chr(10) + Chr(10) + "Do you understand these limitation and still wish to install AVG Antivirus Free Edition anyhow?", "Continue to install AVG Antivirus Free Edition", 36)
   If $promptavgfreeinstall = 6
      Shell @SCRIPTDIR + "\..\avtools\avg71free_394a763.exe"
   EndIf
EndFunction

Function avgpro_Click()
   $promptavgproinstall = MessageBox("Grisoft AVG Antivirus Professional Edition 7.1 is NOT free software.  In order to install the software, you will be required to type in an installation key during installation.  If you are an existing Gipetto customer that purchased AVG Antivirus 7.1 Professional and you have a valid key, please feel free to continue the installation of AVG Antivirus 7.1 Professional Edition.  If you do not have a valid key, please answer no to the question and call Gipetto Tech to obtain your license key."  + Chr(10) + Chr(10) + "Gipetto Tech is an authroized reseller of Grisoft products.  If you would like to install any Grisoft professional product (AVG Antivirus, AVG Firewall, and ewido AntiSpyware), please call Gipetto Tech at (877) 921-6373 to obtain your license." + Chr(10) + Chr(10) + "There should NEVER be more than one antivirus program installed on a computer at any given time.  If you have an antivirus program already, you need to uninstall it before installing AVG Antivirus.", "Continue to install AVG Antivirus 7.1 Professional", 36)
   If $promptavgproinstall = 6
      Shell @SCRIPTDIR + "\..\avtools\avg71f_395a764.exe"
   EndIf
EndFunction

Function ewidoscan_Click()
   $SelectionEwido = MessageBox("This will launch Internet Explorer to open ewido network's online scanner to scan your computer for malware.  Do you wish to continue?", "ewido networks online scan", 36)
   If $SelectionEwido = 6
      Run $Iexplore + " http://www.ewido.net/en/onlinescan/"
   EndIf
EndFunction

Function tmas_Click()
   $Selectiontmas = MessageBox("This will launch Internet Explorer to open Trend Micro's Anti-Spyware for the Web to scan your computer for malware.  Do you wish to continue?", "Trend Micro Anti-Spyware for the Web", 36)
   If $Selectiontmas = 6
      Run $Iexplore + " http://www.trendmicro.com/spyware-scan/"
   EndIf
EndFunction

Function capestscan_Click()
   $Selectioncapest = MessageBox("This will launch Internet Explorer to open Computer Associates eTrust Pest Scan to scan your computer for malware.  Do you wish to continue?", "Computer Associates eTrust Pest Scan", 36)
   If $Selectioncapest = 6
      Run $Iexplore + " http://www3.ca.com/securityadvisor/pest/pestscan.aspx"
   EndIf
EndFunction

Function tmhousecall_Click()
   $Selectioncapest = MessageBox("This will launch Internet Explorer to open Trend Micro HouseCall to scan your computer for viruses.  Do you wish to continue?", "Trend Micro HouseCall", 36)
   If $Selectioncapest = 6
      Run $Iexplore + " http://www.trendmicro.com/hc_intro/default.asp"
   EndIf
EndFunction

Function caav_Click()
   $Selectioncapest = MessageBox("This will launch Internet Explorer to open Computer Associates eTrust Antivirus Web Scanner to scan your computer for viruses.  Do you wish to continue?", "Computer Associates eTrust Antivirus Web Scanner", 36)
   If $Selectioncapest = 6
      Run $Iexplore + " http://www3.ca.com/securityadvisor/virusinfo/scan.aspx"
   EndIf
EndFunction

Function pandaactivescan_Click()
   $Selectioncapest = MessageBox("This will launch Internet Explorer to open Panda Software Antivirus ActiveScan to scan your computer for viruses.  Do you wish to continue?", "Panda Software ActiveScan", 36)
   If $Selectioncapest = 6
      Run $Iexplore + " http://www.pandasoftware.com/activescan"
   EndIf
EndFunction

Function windowsdefender_Click()
   If @PRODUCTTYPE = "Windows 95" Or
      @PRODUCTTYPE = "Windows 98" Or
      @PRODUCTTYPE = "Windows Me" Or
      @PRODUCTTYPE = "Windows NT Workstation" Or
      @PRODUCTTYPE = "Windows NT Server" Or
      @PRODUCTTYPE = "Windows NT Domain Controller" Or
      $Selectiondefendera = MessageBox("Windows® Defender will not run on your current operating system (" + @PRODUCTTYPE + ").  Do you still wish to launch the Windows® Defender homepage so you can read about Windows® Defender?", "Launch Windows® Defender homepage", 36) 
      If $Selectiondefendera = 6
         Run $Iexplore + " http://www.microsoft.com/athome/security/spyware/software/default.mspx"
      EndIf
   EndIf
   If @PRODUCTTYPE = "Windows 2000 Professional" Or
      @PRODUCTTYPE = "Windows 2000 Server" Or
      @PRODUCTTYPE = "Windows 2000 Domain Controller" Or
      @PRODUCTTYPE = "Windows XP Home Edition" Or
      @PRODUCTTYPE = "Windows XP Professional" Or
      @PRODUCTTYPE = "Windows XP Professional Tablet PC" Or
      @PRODUCTTYPE = "Windows XP Media Center Edition" Or
      @PRODUCTTYPE = "Windows XP Starter Edition" Or
      @PRODUCTTYPE = "Windows Starter Edition" Or
      @PRODUCTTYPE = "Windows Server 2003" Or
      @PRODUCTTYPE = "Windows Server 2003 Domain Controller" Or
      @PRODUCTTYPE = "Windows Server 2003 R2" Or
      @PRODUCTTYPE = "Windows Server 2003 R2 Domain Controller" Or
      @PRODUCTTYPE = "Windows Vista Home Edition" Or
      @PRODUCTTYPE = "Windows Vista Professional" Or
      @PRODUCTTYPE = "Windows Vista Professional Tablet PC" Or
      @PRODUCTTYPE = "Windows Vista Media Center Edition" Or
      @PRODUCTTYPE = "Windows Vista Starter Edition" Or
      @PRODUCTTYPE = "Windows Vista Server" Or
      @PRODUCTTYPE = "Windows Vista Domain Controller" Or
      $Selectiondefenderb = MessageBox("To properly run Windows® Defender, your PC must be at Windows® 2000 SP4 or Windows® XP SP2 or higher.  You currently have " + @PRODUCTTYPE + " with " + @CSD + ".  The latest version of Windows® Genuine Advantage (available through Windows® Update) must be installed as well.  If you continue, Internet Explorer will launch to the Windows® Defender homepage so you can read about and/or download Windows® Defender.  Do you wish to continue?", "Launch Windows® Defender homepage", 36) 
      If $Selectiondefenderb = 6
         Run $Iexplore + " http://www.microsoft.com/athome/security/spyware/software/default.mspx"
      EndIf
   EndIf
EndFunction

Function adawarehome_Click()
   Run $Iexplore + " http://www.lavasoftusa.com/"
EndFunction

Function spybothome_Click()
   Run $Iexplore + " http://www.safer-networking.org/en/index.html"
EndFunction

Function spywareblasterhome_Click()
   Run $Iexplore + " http://www.javacoolsoftware.com/spywareblaster.html"
EndFunction

Function ewidohome_Click()
   Run $Iexplore + " http://www.ewido.net/"
EndFunction

Function grisofthome_Click()
   Run $Iexplore + " http://www.grisoft.com/"
EndFunction

Function glive_Click()
   $Selectioncapest = MessageBox("This will launch the installation program to install Gipetto Live to your computer.  This software will do absolutely nothing for you without first calling Gipetto Tech at (877) 921-6373 to speak to a support professional.  Do you wish to continue?", "Installing Gipetto Live!", 36)
   If $Selectioncapest = 6
      Shell @SCRIPTDIR + "\..\glive\setup.exe"
   EndIf
EndFunction

Function exit_Click()
   Quit
EndFunction

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
chadox
KiXforms Dabbler
KiXforms Dabbler


Joined: 03 Jul 2006
Posts: 5

PostPosted: Tue Jul 04, 2006 5:09 am    Post subject: Reply with quote

This is very very close to what I'm looking for. Thank you both, Benny69 and Gargoyle for your immense help. I believe I can handle it from here.

I understand now that by looking over the script that it is actually much easier to call functions for everything rather than Goto statements.

Benny69, one more quick question with regard to one part of your code in particular...

Code:
Function Is_netframeworkinstalled()
   $netframeworkinstalled = KeyExist ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 1.1  (1033)")
   If $netframeworkinstalled = "1"
      If @INWIN = "2"
         Copy @SCRIPTDIR + "\Kixforms.System.dll" "%WinDir%\system" /r
         Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%WinDir%\system" /r
         Shell "%WinDir%\Microsoft.NET\Framework\V1.1.4322\regasm.exe %windir%\system\Kixforms.System.dll /tlb /codebase /silent"
      EndIf
      If @INWIN = "1"
         Copy @SCRIPTDIR + "\Kixforms.System.dll" "%SystemRoot%\system32" /r
         Copy @SCRIPTDIR + "\Kixforms.System.tlb" "%SystemRoot%\system32" /r
         Shell "%SystemRoot%\Microsoft.NET\Framework\v1.1.4322\regasm.exe %SystemRoot%\system32\Kixforms.System.dll /tlb /codebase /silent"
      EndIf
   Else
      Shell @SCRIPTDIR + "\..\REDIST\dotnetfx.exe /q"
      Is_netframeworkinstalled()
   EndIf
EndFunction


I noticed one thing you changed in here with regard to checking for .NET Framework. If the target machine to run this on does not have .NET Framework then it automatically starts installing. Let's just say for arguments's sake that the installation fails (I know, not possible with a Microsoft product Laughing ). Doesn't your repeating check for .NET Framework to be installed then cause an endless loop that is just going to do nothing for the end user? Wouldn't it be more wise to let KiXforms fail on the registering so an error is produced? Or am I wrong?

Lastly,

If you guys could help with this. In my code I'm making repeated use of the @SCRIPTDIR variable to determine the path to run a program from. This may be a stupid question, so I apologize in advance if it is (and I know it's a script more appropriate asked of the kixtart.org forums, so by all means just slap me to the kixtart.org forums if need be)...

Before fully tackling this project I purchased AdminScript Editor. I had looked at it numerous times, but never really had a "need" for it until now. I didn't necessarily need it now either due to the fact that it doesn't do quite what I was hoping for. The feature I wanted most out of AdminScript Editor was the ability to package the script into an executable. After using AdminScript editor I realized that the executable packager does about the same thing as creating a WinZip self compressed EXE. It just unzips the necessary files to a folder inside of the temp directory and runs them from the temp folder.

My question is this... If I package my .KIX up into an executable, how do I get the calls to the external programs located on the CD-Rom drive to work properly now that @SCRIPTDIR points to the %TEMP% folder instead of the CD-Rom?

Would it be best to do something like this at the very beginning of my script to determine the CD Location, or is there a better way of doing it.

Code:
Function FindCD()

$Drives = GetObject("winmgmts:").ExecQuery("select Name,DriveType from Win32_LogicalDisk")

If @error <> 0
  ? @error + " / " @serror
Else
  For Each $Drive in $Drives
    If $Drive.DriveType = 5
         If Exist ($Drive.Name + "\bin\gipey.ico")
           $SystemCDDrive = $Drive.Name
         EndIf
    EndIf
  Next
EndIf

EndFunction


For the above I started with the code found here - http://www.adminscripteditor.com/scriptlibrary/view.asp?id=133. Then I reworked and combined it with the KiXtart 4.51 Reference chm using Sample 2 from COM Automation.

I have no idea what I'm doing with regard to COM Automation. I just kept reworking the script until I somewhat understood what it does and figured out how to make it best suit me.

Again guys, thanks for the help, I really appreciate. Benny69 - thanks for the awesome product that really helped me pull this together - KFD .Net 2.0.
Back to top
View user's profile Send private message Visit poster's website
Gargoyle
KiXforms Aficionado
KiXforms Aficionado


Joined: 30 Dec 2003
Posts: 366
Location: Arizona

PostPosted: Tue Jul 04, 2006 6:38 am    Post subject: Reply with quote

funny you should ask about KORG, and finding a CD Drive. You may want to check out this post over there Determine the CD Drive
_________________
Parents were invented to make children happy by giving them something to ignore.
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Tue Jul 04, 2006 11:53 am    Post subject: Reply with quote

oh man, good catch, I was only focused the converting from the goto statements and totally missed that, you are correct, better to let it fail.

I am an advocate of ASE, and if you are using it to package your script you could use %ASESCRIPTPATH% rather than @SCRIPTDIR, but it is not necessary as they do the same thing.

I think Gargoyle has pointed you in the correct direction, Richard’s UDF is the way to go to find the CD.

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
chadox
KiXforms Dabbler
KiXforms Dabbler


Joined: 03 Jul 2006
Posts: 5

PostPosted: Fri Jul 07, 2006 12:37 pm    Post subject: Reply with quote

Thanks to you guys I figured out exactly how to make my buttons perform as I wanted them to. Awesome, thanks a million!
Back to top
View user's profile Send private message Visit poster's website
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Fri Jul 07, 2006 12:58 pm    Post subject: Reply with quote

Glad I could help
_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group