MSFN Forum: AutoIt Problem - MSFN Forum

Jump to content



Unattended CD/DVD Guide Homepage · MSFN Forum Rules

Welcome to the Applications Installs forum. Make sure you read the forum rules before you start posting.

Links/Requests to warez and/or any illegal material (porn, cracks, serials, etc..) will not be tolerated. Discussion of circumventing WGA/activation/timebombs/keygens or any other illegal activity will also not be tolerated.

We try our best to keep this forum clean of illegal content. If you see any illegal activity use the "report" button you find in every post to report the specific post to the moderators. If you ignore any of the rules you will be banned without notice.

Read Forum Rules
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

AutoIt Problem Finding the cdrom letter Rate Topic: -----

#1 User is offline   rmmastermind 

  • Group: Members
  • Posts: 3
  • Joined: 09-August 06

Posted 18 August 2006 - 09:02 AM

First, Hi to all (I'm new here)
I want to install my favorite game with autoit (with the original dvd)
My script for silent install of my game is done but I'd like to AutoIt retrive my CDRom letter then launch the setup exe
I used this code (batch file)wich occures me a lot of problem(...I'll won't explain it but after many changes I founded no issues), after, launching my compiled script wich installmy game :

FOR %%a in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do IF EXIST %%a:\PKBE_Setup.exe set CDROM=%%a:
"%CDROM%\PKBE_Setup.exe"

I'm looking for the same code in AutoIt language
My setup is PKBE_Setup.exe (in the root of the dvd)
I launch my compiled script from a batch file (from a cd on my other cdrom drive)

I hope someone will help me because I'm unable to write this code :}


#2 User is offline   rmmastermind 

  • Group: Members
  • Posts: 3
  • Joined: 09-August 06

Posted 18 August 2006 - 10:24 AM

I made a little search on the board with 'drivegetdrive' (my other seachs was with 'autoit') and I founded that :
$CD = DriveGetDrive("CDROM")
For $I=1 to Number($CD[0])
$pa = $CD[$I] & "\win51ip.SP2"
If FileExists($pa) Then
$instDrv=$CD[$I]
Endif
Next
ProcessSetPriority ( "setup.exe", 0)
Run($instDrv & "\$oem$\WatchDriverSigningPolicy.exe")
ProcessWait("WatchDriverSigningPolicy.exe")
RunWait($instDrv & "\$oem$\SetupCopyOEMInf.exe " & $instDrv & "\$oem$\Drivers")
ProcessClose("WatchDriverSigningPolicy.exe")
ProcessSetPriority ( "setup.exe", 2)
FileDelete(@SystemDir & "\driver.au3")

After changing it's :

$CD = DriveGetDrive("CDROM")
For $I=1 to Number($CD[0])
$pa = $CD[$I] & "\PKBE_Setup.exe"
If FileExists($pa) Then
$instDrv=$CD[$I]
Endif
Next
Run($instDrv & "\PKBE_Setup.exe")

It seems to work ; I will say you if it works great (because i install the game during windows xp installation...)

Thx

#3 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 19 August 2006 - 01:26 AM

Nice to see that you helped yourself out. Just one thing is you should check @error after using DriveGetDrive() and before using the array to prevent a soft error message from AutoIt which can halt the operation.

I did some changes and was left with this
Global $CD_Letter

$CD_Letter = File_In_CD_Root("PKBE_Setup.exe")

If $CD_Letter Then
	RunWait($CD_Letter & "\PKBE_Setup.exe")
EndIf

Exit

Func File_In_CD_Root($file)
	Local $I, $CD
	$CD = DriveGetDrive("CDROM")
	If Not @error Then
		For $I = 1 to $CD[0]
			If FileExists($CD[$I] & "\" & $file) Then
				Return $CD[$I]
			Endif
		Next
	EndIf
EndFunc

Good luck
:)

#4 User is offline   rmmastermind 

  • Group: Members
  • Posts: 3
  • Joined: 09-August 06

Posted 19 August 2006 - 08:29 AM

I try and take this code if it works...thx
What would be nice is :
If the error comes... have a message box with "it's not the good cd; inser the cd "my game" and press ok" and then when ok is pressed my sript begin again...(even not checking the cdlabel, if my setup.exe doesn't exist, it's not the good cd...)
Any help ? :unsure:

#5 User is offline   MHz 

  • SendToA3X v1.7
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,634
  • Joined: 02-August 04

Posted 21 August 2006 - 12:14 AM

Perhaps my FindCD() UDF here may help you with the message box warnings. :)

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy