Jump to content

Launching a program and leaving it open...


Recommended Posts

Hi everybody!

First of all, WPI rocks!! I discovered it just a few days ago, and it's just what I've been looking for!

Anyway, I've got a question...

Is it possible in the list of commands for a program to have something launched and left open while another program is run? The default behaviour is to wait for program #1 to close, then launch program #2. I would need program #1 running while program #2 launches.

It would be useful for programs which require a serial number but don't save the information clearly in the registry. I would open a notepad window with the serial number and simultaneously the installation of the program. Then, when asked for the serial, I would just Alt-Tab to Notepad, copy and paste it.

Is it possible with WPI? Is there any way to trick the program into doing it?

Thanks everybody, and have a wonderful New Year!!

Ciao,

Ema.

Link to comment
Share on other sites


OK, solved it myself...

Yesterday I was probably too hammered by partying to find a viable solution ;)

I entered the following 2 lines:

cmd /C start /d"%cdrom%\APPS_DRIVERS\Apps" notepad Serial.txt

"%cdrom%\APPS_DRIVERS\Apps\Setup.exe"

Thats's it - pretty obvious... today :)

Ciao,

Ema.

Link to comment
Share on other sites

Thanks guys,

I actually like a certain degree of control over my installations, so I'm not shooting for a totally unattended install, but I'll definitely look both into AutoIt and VBScript :)

BritishBulldog, could you give a sample of code?

Ciao,

Ema.

Link to comment
Share on other sites

here is a copy of a vbs script for Power DVD

set WshShell = WScript.CreateObject ("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

'programme starts

WScript.Sleep 1000
WshShell.RUN ("C:\Programme\CyberLink\PowerDVD\PowerDVD.exe")
WScript.Sleep 2000
WshShell.SendKeys "{TAB 3}"
WScript.Sleep 1000
WshShell.SendKeys " "
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys " "
WScript.Sleep 1000
WshShell.SendKeys "{TAB 2}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 500
WshShell.SendKeys "xxxxx"
WScript.Sleep 500
WshShell.SendKeys "xxxxx"
WScript.Sleep 500
WshShell.SendKeys "xxxxx"
WScript.Sleep 500
WshShell.SendKeys "xxxxx"
WScript.Sleep 500
WshShell.SendKeys "xxxxx"
WScript.Sleep 500
WshShell.SendKeys "xxxxx"
WScript.Sleep 1000
WshShell.SendKeys "{TAB}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "{ENTER}"

the xxxxx are the parts of the serial number

Link to comment
Share on other sites

; <AUT2EXE VERSION: 3.0.102.0>

; ----------------------------------------------------------------------------

; <AUT2EXE INCLUDE-START: D:\XPCD\XP2\Software\DesktopX\DesktopX_2.40_au3.au3>

; ----------------------------------------------------------------------------

; ----------------------------------------------------------------------------

;

; AutoIt Version: 3.0

; Language:    English

; Platform:    Win9x / NT

; Author:      Nologic

;

; Script Function:

; Stardock DesktopX v2.40

;

; ----------------------------------------------------------------------------

; ----------------------------------------------------------------------------

; End User Var"s

; ----------------------------------------------------------------------------

$SF_1 = "DesktopX240__enhanced.exe" ; Setup File Name

$SN_1 = "xxxxxxxxxxxxxxxxxxxxxx" ; Serial Number

;$SM_1 = "\DesktopX"    ; Location For Main  Folder

;$GM_1 = "\Tools - Shell" ; Location For Group Folder

; Delete DesktopX Short Cuts

;$SC_1 = "N"  ; (Y)es or (N)o - Delete Short Cut For DesktopX

;$SC_2 = "Y"  ; (Y)es or (N)o - Delete Short Cut For DesktopX Readme

;$SC_3 = "N"  ; (Y)es or (N)o - Delete Short Cut For Developers Guide

;$SC_4 = "Y"  ; (Y)es or (N)o - Delete Short Cut For Online Documentation & FAQ

;$SC_5 = "N"  ; (Y)es or (N)o - Delete Short Cut For Scripting Guide

;$SC_6 = "Y"  ; (Y)es or (N)o - Delete Short Cut For Uninstall DesktopX

;$SC_7 = "N"  ; (Y)es or (N)o - Delete Short Cut For Users Guide

; ----------------------------------------------------------------------------

; Prevent Duplicates From Running

; ----------------------------------------------------------------------------

$g_szVersion = $SF_1

If WinExists($g_szVersion) Then Exit ; It"s already running

AutoItWinSetTitle($g_szVersion)

; ----------------------------------------------------------------------------

; Script Defaults

; ----------------------------------------------------------------------------

Opt ("CaretCoordMode", 1) ;1=absolute, 0=relative

Opt ("ExpandEnvStrings", 0) ;0=don't expand, 1=do expand

Opt ("MouseClickDelay", 10) ;10 milliseconds

Opt ("MouseClickDownDelay", 10) ;10 milliseconds

Opt ("MouseClickDragDelay", 250) ;250 milliseconds

Opt ("MouseCoordMode", 0) ;1=absolute, 0=relative

Opt ("MustDeclareVars", 0) ;0=no, 1=require pre-declare

Opt ("PixelCoordMode", 1) ;1=absolute, 0=relative

Opt ("RunErrorsFatal", 1) ;1=fatal, 0=silent set @error

Opt ("SendAttachMode", 0) ;0=don't attach, 1=do attach

Opt ("SendCapslockMode", 1) ;1=store and restore, 0=don"t

Opt ("SendKeyDelay", 1) ;5 milliseconds

Opt ("SendKeyDownDelay", 1) ;1 millisecond

Opt ("TrayIconDebug", 0) ;0=no info, 1=debug line info

Opt ("TrayIconHide", 0) ;0=show, 1=hide tray icon

Opt ("WinDetectHiddenText", 0) ;0=don't detect, 1=do detect

Opt ("WinSearchChildren", 1) ;0=no, 1=search children also

Opt ("WinTitleMatchMode", 3) ;1=start, 2=subStr, 3=exact, 4=...

Opt ("WinWaitDelay", 250) ;250 milliseconds

; ----------------------------------------------------------------------------

; Script Start

; ----------------------------------------------------------------------------

Run  ( $SF_1 )

;Enter Serial Number

WinWaitActive ( "Enter DesktopX Serial Number" )

ControlSetText ( "Enter DesktopX Serial Number", "", "Edit1", $SN_1 )

ControlClick ( "Enter DesktopX Serial Number", "OK", "Button2" )

; License

Sleep ( 500 )

If WinExists ( "License Agreement" ) = 1 Then

ControlClick ( "License Agreement", "I Agree", "Button4" )

ControlClick ( "License Agreement", "&Next >", "Button1" )

EndIf

;Welcome

WinWaitActive ( "Welcome" )

ControlClick ( "Welcome", "&Next >", "Button1" )

;Destination Location

WinWaitActive ( "Choose Destination Location" )

;ControlClick ( "Choose Destination Location", "B&rowse...", "Button5" )

;Choose Folder

;WinWaitActive ( "Select Destination Directory" )

;ControlSetText ( "Select Destination Directory", "", "Edit1", @ProgramFilesDir & $GM_1 & $SM_1 )

;ControlClick ( "Select Destination Directory", "OK", "Button1" )

;Destination Location (Continued)

;WinWaitActive ( "Choose Destination Location" )

ControlClick ( "Choose Destination Location", "&Next >", "Button1" )

;Start Installation

WinWaitActive ( "Start Installation" )

ControlClick ( "Start Installation", "&Next >", "Button1" )

;Finish

WinWaitActive ( "Installation Complete" )

ControlClick ( "Installation Complete", "&Finish >", "Button1" )

If WinExists( "Object Desktop") Then

  WinClose( "Object Desktop")

EndIf

#cs

; Create Directorys if Non-Existant

If FileExists ( @ProgramsCommonDir & $GM_1 ) = 0 Then DirCreate ( @ProgramsCommonDir & $GM_1 )

; Copy Directorys

DirCopy  ( @ProgramsDir & "\Object Desktop\DesktopX", @ProgramsCommonDir & $GM_1 & $SM_1 , 1 )

; Copy Files

FileCopy ( @ProgramsDir & "\Object Desktop\DesktopX.lnk", @ProgramsCommonDir & $GM_1 & $SM_1 & "\DesktopX.lnk" , 1 )

; Delete Old Directory

DirRemove  ( @ProgramsDir & "\Object Desktop", 1 )

; Delete DesktopX Short Cuts

$local = @ProgramsCommonDir & $GM_1 & $SM_1 & "\"

If $SC_1 = "y" Then FileDelete ( $local & "DesktopX.lnk" )

If $SC_2 = "y" Then FileDelete ( $local & "DesktopX Readme.lnk" )

If $SC_3 = "y" Then FileDelete ( $local & "Developers Guide.lnk" )

If $SC_4 = "y" Then FileDelete ( $local & "Online Documentation & FAQ.lnk" )

If $SC_5 = "y" Then FileDelete ( $local & "Scripting Guide.lnk" )

If $SC_6 = "y" Then FileDelete ( $local & "Uninstall DesktopX.lnk" )

If $SC_7 = "y" Then FileDelete ( $local & "Users Guide.lnk" )

#ce

Exit

;EOF

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
  • Recently Browsing   0 members

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