Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Sims 2 Auto It Script Help

- - - - -

  • Please log in to reply
7 replies to this topic

#1
ender341

ender341

    Member

  • Member
  • PipPip
  • 158 posts
  • Joined 18-January 05
I have a working script that runs fine if i run it in windows, but if I try to run in from RunOnceEx it tells me it can't find

C:\AutoRunGUI.dll

but the script is being run from

%PP%Disk Images\Disk1

so if anything it should be searching there

so my question is does anyone know how to fix this, or if not how to do something similar to:

FOR %%i IN (C 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 %%i:\HD.txt SET PP=%%i:

in autoit?


How to remove advertisement from MSFN

#2
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,654 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag
Cannot access the best solution to your problem with the current information.

Some questions need answers:
Q. Disk Images\Disk 1. Is this a 1 cd compilation?
Q. Is this a multi-boot cd?
Q. Is Sims 2 loaded from files in a folder or a mounted ISO?
Q. Is Sims 2 loaded from the Harddrive?
Q. Is RunOnceEx running the game executable or AutoRunGUI.dll or ...?
Q. Where is this AutoRunGUI.dll in reference to your RunOnceEx?
Q. Where is this AutoRunGUI.dll in reference to your AutoIt script?
Q. Is your RunOnceEx file a cmd file or a AutoIt script?
Q. Could you post the part of the script that seems to be causing the issue.

I could come up with more questions indeed...
Simply put, too many questions to give any kind of solution currently. I do not know if you even need a find drive letter function, for what type of drive? or that you are presumably using a cmd file, so it would render it perhaps useless in your case? More informatiom would be nice.

#3
ender341

ender341

    Member

  • Member
  • PipPip
  • 158 posts
  • Joined 18-January 05

Q. Disk Images\Disk 1. Is this a 1 cd compilation?
Q. Is Sims 2 loaded from files in a folder or a mounted ISO?
Q. Is Sims 2 loaded from the Harddrive?

<{POST_SNAPBACK}>


it is copies of the disks on my HD. The reason it is in the misleading named folders was i was following EA's directions to create a backup on the HD of the Game. there are multiple folders (Disk 1, Disk 2, Disk 3, Disk 4). It is not an image.

Q. Is this a multi-boot cd?

<{POST_SNAPBACK}>


No, it only installs XP Pro

Q. Is RunOnceEx running the game executable or AutoRunGUI.dll or ...?

<{POST_SNAPBACK}>


Runonce is only calling the Autoit Script which in turn calls the AutoRun.exe (which depends on the AutoRunGUI.dll and runs the sims 2 setup)

Q. Where is this AutoRunGUI.dll in reference to your RunOnceEx?
Q. Where is this AutoRunGUI.dll in reference to your AutoIt script?

<{POST_SNAPBACK}>


RunOnceEx is in the root of the drive
the Autoit script and AutoRunGUI.dll file are both in "Images\Disk 1" of the disk

Q. Is your RunOnceEx file a cmd file or a AutoIt script?

<{POST_SNAPBACK}>


its a .cmd file that calls the Autoit Script for some of my installs

Q. Could you post the part of the script that seems to be causing the issue.

<{POST_SNAPBACK}>


RUN("AutoRun.exe")

its at that that it calls autorun which depends on AutoRunGUI.DLL

normally i would just hardcode the drive letter in, but windows install likes to mess with my head and change drive letters on each install i do

its kinda strange though cause it works fine if i double click on the script in windows though

#4
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,654 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag
Well, I would first consider it as a working directory issue. A path could be allocated to the command interpreter, to allow autorun.exe, to see with in it's own directory or you may need to specify in the AutoIt script of the current working directory.
A solution in your AutoIt script could be
Run(@ScriptDir & '\Autorun.exe', @ScriptDir)
or you could go alittle more excessive with
; Backup the current working directory
$directory = @WorkingDir
; Change to the script directory, if not already
FileChangeDir(@ScriptDir)
; Run the executable with the working directory as the script directory
Run(@ScriptDir & '\Autorun.exe', @ScriptDir)

; Restore working directory at end of script
FileChangeDir($directory)

Or you can type Start /? into a command interpreter window, and it will show you parameters to use, especially on the path parameter.

I would try these concepts out before going any further. As I would consider that one of these would solve your problem, with fingers crossed.

#5
ender341

ender341

    Member

  • Member
  • PipPip
  • 158 posts
  • Joined 18-January 05
Thank you so much, I have been rackimg my brain over this all day.

If i may ask, what is the differnece between single and double quotes in Autoit?

This Worked
Run(@ScriptDir & '\Autorun.exe', @ScriptDir)

[Edit] I will be Adding this script to the sticky

Edited by ender341, 12 August 2005 - 02:33 AM.


#6
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,654 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag
Single or double quotes are both allowed in AutoIt use. I use singles as I find it convenient in usage. No shift key required to insert, running a Comspec line is easier to manage as doubling up quotes are not normally needed. For example:
Run(@Comspec & ' /c "' & @ScriptDir & '\Autorun.exe" /s')
Notice how I can easily insert the double quotes that Comspec may require for a long path easily within the single quotes. This makes the script easy to interpret.

#7
ender341

ender341

    Member

  • Member
  • PipPip
  • 158 posts
  • Joined 18-January 05
Thanks, Looking at that it actually makes alot of sense :thumbup

#8
MHz

MHz

    Just simple

  • Member
  • PipPipPipPipPipPipPip
  • 1,654 posts
  • Joined 02-August 04
  • OS:Windows 7 x64
  • Country: Country Flag
Your Welcome :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users