You are here

Age of Empires

15 posts / 0 new
Last post
gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
Age of Empires

I am creating Age of Empires 1 Portable. This is NOT going to be distributed in any way as this is for my personal use. I will be happy to upload the launcher for anyone who wants it.

I have created a launcher for the game. However, when it starts to launch, I get an error: "Could not initialize graphics system. Make sure that your video card and driver are compatible with DirectDraw." I cannot figure out why it gives me this error.

I am able to launch the game directly from within the App/AgeOfEmpires folder and it works fine. But when launching from the NSIS Launcher, it gives me this error. I believe it may have something to do with changing the screen resolution, but I do not know how to fix it.

Any suggestions would be appreciated.

Thanks.

gluxon
gluxon's picture
Offline
Last seen: 4 years 2 months ago
Developer
Joined: 2008-06-21 19:26
Could you please show us the

Could you please show us the source code? We can't really help you without seeing what's wrong.

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
Sorry about that. Forgot to

Sorry about that. Forgot to include it.

Ah ok. Thanks for the tip. I had never heard of pastebin before.

Here it is: http://pastebin.com/m667334bc

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
Thanks for putting that on

Thanks for putting that on pastebin; it's much more readable that way.

I just looked over the launcher; I don't own Age of Empires, so I can't verify the correctness of the Registry key locations or anything like that, but it looks good to me. Quite possibly it's something due to Age of Empires, not your launcher.

EDIT: maybe it's looking for a graphics library someplace? Perhaps a DirectDraw library?

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
Well I am not sure what it

Well I am not sure what it could be. I am able to run the EXE directly from the folder and it works fine. Its only when I launch from the NSIS Launcher that it gives me that error.

In order to try and find out what it could be, I ran a debugger with the actual EXE and it gave me the same error. It seems that the exe does not like being launched from another program, but only directly. I'll see if theres a way around that.

Thanks for the info.

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
I noticed that in the Data

I noticed that in the Data directory alongside the settings folder, there are temporary files being created during runtime of the launcher. I am not sure why they are created in that directory. I could not find anything in the script that redirects any environment variables when running the launcher.

Since I am new to NSIS, could you take a look at it for me and see if you find anything about that directory? I looked through, but from what I could tell it isn't supposed to be placing files into that directory.

Thanks.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
What kind of filenames do the

What kind of filenames do the temp files have? If you comment out the ${registry::SaveKey} calls during CheckRunning, are the temp files still created?
I don't see any system redirections either, so I'm not sure what's going on unless RegEdit is creating temp files. I can't imagine why that would happen, and it's something I've never seen, but still...

EDIT: Something interesting just occurred to me. If you comment out all the Registry-handling code, what happens? Also, do any of the AoE keys store path information? If they do, the reg keys could be pointing AoE to the Data folder, which could also explain your error - AoE is looking for some library in the wrong folder.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
The filenames are Border.drs,

The filenames are Border.drs, graphics.drs, Interfac.drs (Interfac, not Interface), and Terrain.drs.

I commented out everything that pertained to the registry. I still got the error and the temp files were still created.

I posted the updated source with the comments on pastebin.

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
I know what is wrong! In the

I know what is wrong! In the AgeOfEmpires folder that contains the exes, there is a folder that is called data that contains those four files and more. So when launching the exe, it tries to access its data files from the root folder and I need it to access them from the folder in which the exe is located.

If you need a better explanation, I will upload some pics.

Thanks.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
Yep, I understand what you're

Yep, I understand what you're saying - no need for pics, thanks.
There's a couple of things you can try.
First, the NSIS SetOutPath call might help you; that changes the current output folder, which could be just what you need.
If that doesn't work, get Process Explorer; run AoE from the launcher and by itself, and record the command-line it's getting in both cases. Then, you should be able to do something with the $CMDLINE variable to fix any problems (differences).

Let me know how it goes!

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
Using SetOutPath worked

Using SetOutPath worked perfectly! Thank so much for your help. I may put the launcher up when its completed if anyone is interested in using it. The game will NOT be included.

Thanks again for all your help.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
Glad to hear you got it

Glad to hear you got it working! Have fun! Smile

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

tyrandan2
Offline
Last seen: 14 years 9 months ago
Joined: 2010-02-08 11:33
DEFINITELY

Glad to see you got it working, please upload it when it's finished!

To wit, that we are all fools....

gamewolf
Offline
Last seen: 14 years 8 months ago
Joined: 2010-01-24 20:31
Here is the link for the

Here is the link for the launcher.

https://portableapps.com/node/22512

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 2 months ago
Developer
Joined: 2009-08-11 11:24
Pastebin

Please put the source code on Pastebin and post the link instead of directly posting the code; that's significantly more readable.

Thanks!

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Log in or register to post comments