Jump to content

Timing


Islmike
 Share

Recommended Posts

Hi all.

I am working on a script that has many parts to it. The application is an in house developed type, (home grown) which requires Oracle 11gr2. In my script below, the installation of Oracle with minimal options goes first, however I need for the process to not continue until this installation is completed. I am new to AutoIT. Any help will be greatly appreciated.

Here is my script:

SplashTextOn("BIZ Planning Installation", "Please wait while BIZ Planning for Access 2010 is installed.", -1, -1, -1, -1, 18, "", 25)


DriveMapAdd("X:", "\\ServerName\Packages\Software Distribution\")
Sleep(30000)
SplashOff()

;Oracle 11gR2 installation
SplashTextOn("BIZ Planning Installation", "Please wait while Oracle 11gR2 components are installed.", -1, -1, -1, -1, 18, "", 25)
;Check for Oracle 11gR2
For $i = 1 to 100
$var = RegEnumVal("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C1A4AAAD-6D9E-4432-8A88-FA1508DF5F8F}", $i)
If @error <> 0 Then
call ("fOracle11gR2")
ExitLoop

Else
DriveMapAdd("X:", "\\ServerName\Packages\Software Distribution")
FileChangeDir("X:\Oracle11gR2")
#RequireAdmin
RunWait(@ComSpec & " /c " & "setup.exe -responseFile X:\Oracle11gR2\install\client.rsp -silent -nowait", @WorkingDir, @SW_HIDE)
ExitLoop

EndIf

Next
Sleep(1000000) ;10 minute wait  so full Oracle Client install can complete - required for dependent file copy commands to be successful.

;Removes mapped DriveGetDrive
DriveMapDel("X")

  ;Oracle Standard Installation
Func fOracle11gR2()
DriveMapAdd("X:", "\\ServerName\Packages\Software Distribution")
FileChangeDir("X:\Oracle11gR2")
#RequireAdmin
RunWait(@ComSpec & " /c " & "setup.exe -responseFile X:\Oracle11gR2\install\client.rsp -silent -nowait", @WorkingDir, @SW_HIDE)
 EndFunc

Sleep(600000) ;10 minute wait  so full Oracle Client install can complete - required for dependent file copy commands to be successful.

;TNSnames Installation
;Func fTNSNamesW7()
FileChangeDir("X:\TNSNamesW7")
RunWait(@ComSpec & " /c " & "TNSNamesW7.exe", @WorkingDir, @SW_HIDE)
SplashOff()
FileChangeDir(@scriptdir)
;EndFunc

Call ("fRegSet")

;BIS DSN Settings
Func fRegSet()
SplashTextOn("BIZ Planning Installation", "Please wait while BIZ Settings are installed.", -1, -1, -1, -1, 18, "", 25)
sleep(200000)
Splashoff()
SplashTextOn("BIZ Planning Installation", "Creating ODBC Connections.", -1, -1, -1, -1, 18, "", 25)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Access Connectivity Engine\Engines", "SandboxMode", "Reg_Dword", "2")
    DriveMapAdd("X:", "\\ServerName\packages\software distribution")
    #RequireAdmin
    FileChangeDir("X:\BizPlanW7")
    Run(@ComSpec & " /c " & "Regedit.exe /s BIS.reg", @WorkingDir, @SW_HIDE)
    Run(@ComSpec & " /c " & "Regedit.exe /s BizPlanning.reg", @WorkingDir, @SW_HIDE)
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources", "BIS_MKTP1", "Reg_SZ", "Oracle in OraClient11g_home1")
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources", "BizPlanning_MKTP1", "Reg_SZ", "Oracle in OraClient11g_home1")
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C1A4AAAD-6D9E-4432-8A88-FA1508DF5F8F}","Oracle11Installed", "Reg_Dword", "1")
EndFunc

Call ("fBIZPlan")

; Copy code for BIZPlanning.mde into place
Func fBIZPlan()
SplashTextOn("BIZ Planning WinInstallation", "Finalizing BIZ Planning Installation Copying Files.", -1, -1, -1, -1, 18, "", 25)
FileChangeDir("X:\BIZPLANW7")
DirCreate("C:\BIZPlanning")
DirCreate("C:\BizPlanning\Photos\Util")
DirCreate("C:\BIZPlanning\photos\csImageFile")
DirCreate("C:\BIZPlanning\data")
DirCreate("C:\Oracle\app\product\11.2.0\client_1\Network\Admin")
FileCopy("csImageFile.dll", "C:\BIZPlanning\photos\csImageFile", 1)
FileCopy("curl.exe", "C:\BIZPlanning\photos\Util", 1)
FileCopy("BizPlanning.mde", "C:\BIZPlanning", 1)
FileCopy("BizPlanningInfo.mdb", "C:\BIZPlanning\data", 0)
FileChangeDir(@desktopcommondir)
FileDelete("BIZ*.*")
filechangedir(@desktopdir)
FileDelete("BIZ*.*")
FileChangeDir("X:\BIZPLANW7\Shortcut")
FileCopy("BIZ Planning.*", "C:\Users\Public\desktop", 1)
 EndFunc

Call ("fTNSNamesW7")

Func fTNSNamesW7()
    FileChangeDir("X:\BIZPLANW7")
#RequireAdmin
FileCopy("TNSNames.ora", "C:\Oracle\App\Product\11.2.0\Client_1\Network\Admin", 1)
 EndFunc

Call("fXGOAway")

Func fXGOAway()
    DriveMapDel("X")
SplashTextOn("BIZ Planning for Access 2010 Installation", "COMPLETED THANK YOU.", -1, -1, -1, -1, 2, "", 15)
Sleep(190000)
    SplashOff()
 EndFunc

#include <Process.au3>
Local $rc = _RunDos("C:\Windows\SysWOW64\regsvr32 /s C:\BizPlanning\photos\csImageFile\csImageFile.dll")

Exit
Edited by Melba23
Added code tags
Link to comment
Share on other sites

  • Moderators

Islmike,

When you post code in future, please use [autoit] [/autoit] tags to enclose it - then you get the syntax colouring and scrolling box you now see above which makes it much easier to read. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Just to be clear all. Below is the part of the script in need to have completed before the remaining part of the script starts.

I guess I can have the script check for specific directory or reg key before it continues, but I am not sure and looking for suggestions.

Else
DriveMapAdd("X:", "\\ServerName\Packages\Software Distribution")
FileChangeDir("X:\Oracle11gR2")
#RequireAdmin
RunWait(@ComSpec & " /c " & "setup.exe -responseFile X:\Oracle11gR2\install\client.rsp -silent -nowait", @WorkingDir, @SW_HIDE)
ExitLoop

EndIf

Next
Sleep(1000000) ;10 minute wait so full Oracle Client install can complete - required for dependent file copy commands to be successful.
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...