Jump to content

why won't this work


debstep
 Share

Recommended Posts

I Have the following script:

for some reason it pauses and hangs about half way through, but it was working before?????

PLease help

;AutoIt Version 3.1.0 Script

#include <File.au3>

#include <Constants.au3>

#include <GUIConstants.au3>

#include <String.au3>

#include <array.au3>

if NOT IsAdmin() Then

MsgBox(0,"", "You need adminstrative Rights to run this program...exiting",5)

exit

elseif ISADMIN() then

MsgBox(0, "", "Admin rights detected",5)

EndIf

GuiCreate("Computer Information ", 469, 639,(@DesktopWidth-469)/2, (@DesktopHeight-639)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$ComputerName = GuiCtrlCreateLabel("Computer Name", 10, 10, 150, 20)

$CurrentUserName = GuiCtrlCreateLabel("Current User Name", 10, 40, 150, 20)

$Operatingsystem = GuiCtrlCreateLabel("Operating System Type", 10, 70, 150, 20)

$OpSysVersion= GuiCtrlCreateLabel("Operating System Version",10,100,150,20)

$ServicePack = GuiCtrlCreateLabel("Service Pack", 10, 130, 150, 20)

$WindowsDirectory = GuiCtrlCreateLabel("Windows Directory", 10, 160, 150, 20)

$SystemFolderDirectory = GuiCtrlCreateLabel("System Folder Directory", 10, 190, 150, 20)

$ProgramFileDirectory = GuiCtrlCreateLabel("Program File Directory", 10, 220, 150, 20)

$JREInstalled =GUiCtrlCreateLabel("JRE Installed",10,250,150,20)

$JDKInstalled = GUICtrlCreateLabel("JDK Installed",10,280,150,20)

msgbox(0,"debug1","DEBUG after Create CtrlsLabels",5)

;Check for JRE installed and version

Dim $JRE[1]

Dim $JREpath[1]

Dim $Count= 1

Do

$JREkey= RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment",$Count)

If not $JREkey = "" Then

$JREloc= RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"&"\" & $JREkey,"JavaHome")

redim $JRE[$Count]

redim $JREpath[$Count]

$JRE[$Count-1]=$JREkey

$JREpath[$Count-1]=$JREloc

$Count = $Count +1

Else

$JREkey=""

Endif

until $JREkey= ""

$jmsg=""

For $i = 0 to ubound ($JRE)-1

$jmsg= $jmsg & $JRE[$i]& @tab & @tab & $JREPath[$i] & @LF

if $jmsg="" then

$jmsg = " There are no JRE's installed and registered on this machine..."

EndIF

next

msgbox(0,"debug1","DEBUG after Search for JRE",5)

;Check for JDK

Dim $JDK[1]

Dim $JDKpath[1]

Dim $JCount= 1

Do

$JDKkey= RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit",$JCount)

If not $JDKkey = "" Then

$JDKloc= RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"&"\" & $JDKkey,"JavaHome")

redim $JDK[$JCount]

redim $JDKpath[$JCount]

$JDK[$JCount-1]=$JDKkey

$JDKpath[$JCount-1]=$JDKloc

$Count = $JCount +1

Else

$JDKkey=""

Endif

until $JDKkey= ""

$jdmsg=""

For $i = 0 to ubound ($JDK)-1

$jdmsg= $JDK[$i]& @tab & @tab & $JDKPath[$i] & @LF

if $jdmsg="" then

$jdmsg = "There are no JDK's installed and registered on this machine..."

EndIF

next

msgbox(0,"debug3","DEBUG after Search for JDK",5)

;Check for Operating system installed

;The included macros do not provide all info I want....Contact Re: service pack and build numbers through Macro

;Need Caption, Service pack, major and minor version, build number

$OS=@OSVERSION

Select

Case $OS="WIN_95"

$OS="Windows 95"

Case $OS="WIN_98"

$OS="Windows 98"

Case $OS="WIN_XP"

$OS="Windows XP"

Case $OS="WIN_2000"

$OS="Windows 2000"

Case $OS="WIN_ME"

$OS="Windows Millenium Edition"

Case $OS="WIN_NT4"

$OS="Windows NT 4"

ENDSelect

msgbox(0,"debug4","after convert OS Tags",5)

msgbox(0,"ACK", "WHY DOES THE SCRIPT PAUSE HERE???",5)

;Display results of OS and JDK Query in Msgbox

msgbox(0,"debug5","about to display Sysdetails",5)

$oldsysdetails= $OS & @tab _

@OSSERVICEPACK & @tab & @LF _

"Build Number: " & @tab & @OSBUILD & @LF _

"System Dir:" & @tab & @SystemDir & @LF _

"Win Dir: " & @tab & @WindowsDir & @LF _

"Program Files Dir" & @tab & @ProgramfilesDir & @LF _

"JRE Installed " & @LF & $jmsg _

"JDK Installed " & @LF & $jdmsg

$sysdetails = stringaddcr($oldsysdetails)

msgbox(0, "System Info", $sysdetails,10)

;Display results of query on Form

$Input_ComputerName = GuiCtrlCreateInput("" & @ComputerName, 180, 10, 280, 20)

$Input_CurrentUserName = GuiCtrlCreateInput("" & @UserName, 180, 40, 280, 20)

$Input_OperatingSystem = GuiCtrlCreateInput("" & @OSTYPE, 180, 70, 280, 20)

$Input_OSVersion=GuiCtrlCreateInput("" & $OS,180,100,280,20)

$Input_ServicePack = GuiCtrlCreateInput("" & @OSServicePack, 180, 130, 280, 20)

$Input_WindowsDirectory = GuiCtrlCreateInput("" & @WindowsDir, 180, 160, 280, 20)

$Input_SystemFolderDirectory = GuiCtrlCreateInput("" & @SystemDir, 180, 190, 280, 20)

$ProgramFileDirectory = GuiCtrlCreateInput("" & @ProgramFilesDir, 180, 220, 280, 20)

$Input_JREInstalled =GUiCtrlCreateCombo("",180,250,280,20,)

$Input_JDKInstalled =GuiCtrlCreateCombo("",180,280,280,20)

;sort through the array and separate the strings and to add to the Combo boxes

For $i = 0 to ubound ($JRE)-1

$jmsg= $JRE[$i]& " " & $JREPath[$i]

if $jmsg<>"" then

GuiCtrlSetdata($Input_JREInstalled,$jmsg,$jmsg)

elseif $jmsg="" then

$jmsg = " There are no JRE's installed and registered on this machine..."

EndIf

next

For $i = 0 to ubound ($JDK)-1

$jdmsg= $JDK[$i]& " " & $JDKPath[$i]

if $jdmsg<>"" then

GuiCtrlSetdata($Input_JDKInstalled,$jdmsg,$jdmsg)

elseif $jdmsg="" then

$jdmsg = "There are no JRE's installed and registered on this machine..."

EndIf

next

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

Wend

Exit

Link to comment
Share on other sites

  • Developers

AutoIt3 probably end with an error ?.....

$oldsysdetails= $OS & @tab & _

@OSSERVICEPACK & @tab & @LF & _

"Build Number: " & @tab & @OSBUILD & @LF ?& _

"System Dir:" & @tab & @SystemDir & @LF & _

"Win Dir: " & @tab & @WindowsDir & @LF & _

"Program Files Dir" & @tab & @ProgramfilesDir & @LF & _

"JRE Installed " & @LF & $jmsg & _

"JDK Installed " & @LF & $jdmsg

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I Have the following script:

for some reason it pauses and hangs about half way through, but it was working before?????

PLease help

<{POST_SNAPBACK}>

your script does hang but you get an error in
$oldsysdetails= $OS & @tab &_
      @OSSERVICEPACK & @tab & @LF &_ 
"Build Number: " & @tab & @OSBUILD & @LF &_
      "System Dir:" & @tab & @SystemDir & @LF &_
      "Win Dir: " & @tab & @WindowsDir & @LF& _
      "Program Files Dir" & @tab & @ProgramfilesDir & @LF &_
      "JRE Installed " & @LF & $jmsg &_
      "JDK Installed " & @LF & $jdmsg

you miss the &

Link to comment
Share on other sites

your script does hang but you get an error in

$oldsysdetails= $OS & @tab &_
      @OSSERVICEPACK & @tab & @LF &_ 
"Build Number: " & @tab & @OSBUILD & @LF &_
      "System Dir:" & @tab & @SystemDir & @LF &_
      "Win Dir: " & @tab & @WindowsDir & @LF& _
      "Program Files Dir" & @tab & @ProgramfilesDir & @LF &_
      "JRE Installed " & @LF & $jmsg &_
      "JDK Installed " & @LF & $jdmsg

you miss the &

<{POST_SNAPBACK}>

I tried this and I am still getting an error that says unable to parse line???
Link to comment
Share on other sites

  • Developers

for some reason, the script appears to be hanging here:

$OS=@OSVERSION

I put a debug msgbox after this line and this is where the script hangs...

wierd...

<{POST_SNAPBACK}>

Do you see the msbox ?

Isn't it behind another window ?

maybe remove all the msgboxes and see what it does.....

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I tried this and I am  still getting an error that says unable to parse line???

<{POST_SNAPBACK}>

$oldsysdetails= $OS & @tab & @OSSERVICEPACK & @tab & @LF & "Build Number: " & @tab & @OSBUILD & @LF & "System Dir:" & @tab & @SystemDir & @LF&"Win Dir: " & @tab & @WindowsDir & @LF & "Program Files Dir" & @tab & @ProgramfilesDir & @LF & "JRE Installed " & @LF & $jmsg & "JDK Installed " & @LF & $jdmsg

I got it to run just putting it all on one line...

Link to comment
Share on other sites

Do you see the msbox ?

Isn't it behind another window ?

maybe remove all the msgboxes and see what it does.....

<{POST_SNAPBACK}>

I found the error:

In the find JDK section I had

$JCount = $Count +1

and it should be

$JCount = $JCount +1

:lmao:

DO you know of any way to get the values of the operating System , like windows XP PROFESSIONAL or HOME or the SERVERpart of a caption?

OR do you know where I can find a list of the build numbers for each windows operating system ( I have looked everywhere but the right place) ...I need to know if the Operating system is a server....

THanks

Link to comment
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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