You are here

[Solved]Portablied version of program crashes, normal doesn't.

7 posts / 0 new
Last post
Bennieboj
Bennieboj's picture
Offline
Last seen: 5 years 1 week ago
Joined: 2010-09-16 07:28
[Solved]Portablied version of program crashes, normal doesn't.

Hi everyone,

I wanted to make a portable version of a game, for personal use only, since I bought the game myself. (Is this allowed?)
I extracted the installer, got all the files, they work, run, do everything I want to when ran from any location.

Now i wanted to make this little game portable. I made the *gamenameportable*launcher.ini. (As you can see I left out the name of the game, I wasn't sure if I was allowed to do this in the first place.)

[Launch]
AppName=*gamename*Portable
ProgramExecutable=*gamename*\*gamename*.exe
LaunchAppAfterSplash=true

[DirectoriesMove]
Save\*gamename*\=%DOCUMENTS%\Games\*gamename*\

This should copy all the files I need. (Is there something wrong with this file?)
I haven't had time to check for registry keys and such, I wanted to do that after I knew the files were copied correctly, but since the game crashes when the launcher opens it I can't test that either. The game opens, changes the resolution and a second after that windows' Werfault.exe tells me the program has encountered an error.
When I run the game directly from its folder (without the launcher) or in a .bat script it runs just fine. Since I didn't make the game myself I can't give more information.

I also used debug.nsh, but since this contains the name of the game I won't post it untill it's needed.

Thanks for reading, can someone help me, please?

Ken Herbert
Ken Herbert's picture
Online
Last seen: 32 min 55 sec ago
DeveloperModerator
Joined: 2010-05-25 18:19
Where are you getting

Where are you getting CopyFromDirectory and CopyToDirectory from? These don't exist in the launcher manual under DirectoriesMove.

Bennieboj
Bennieboj's picture
Offline
Last seen: 5 years 1 week ago
Joined: 2010-09-16 07:28
I don't really know, I found

I don't really know, I found them on some page I can't find anymore...
Anyways, thanks for the tip. I removed those line (also from the top post) and re-ran the launcher generator and still have the same problem.
Do I have to post the debug.log, or how can I give more information so that you can help me?

Yes, I set the working directory!

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 weeks ago
Joined: 2007-04-15 21:08
Something incomplete in the environment

For personal use, you are not likely to be breaking the law; refer to the product's EULA for accurate guidance, however.

[DirectoriesMove] doesn't work correctly if the parent of the source directory doesn't exist; this is one reason that we avoid using subdirectories in [DirectoriesMove]; (I have no interest in fixing it as a flatter structure tends in my opinion to be better;) additionally, trailing backslashes are not supported (they may work in some places, but they definitely don't in some places). The end result is that your [DirectoriesMove] should contain just a single line something like SavedGames=%DOCUMENTS%\Games\gamename.

The nub of the issue is likely to be that the batch file sets something up which you haven't done; likely candidates are environment variables (set statements in the batch file) and command line arguments. Make sure you're doing all that the batch file does in the launcher, or if you wish you can run the .bat file instead of the .exe file from the launcher (we don't recommend it for released apps here, largely because it just adds overhead, but for an app of your own you probably don't need to worry about that).

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Bennieboj
Bennieboj's picture
Offline
Last seen: 5 years 1 week ago
Joined: 2010-09-16 07:28
Ok, I removed the trailing

Ok, I removed the trailing backslashes. Still same problem...
The only thing that is in my batch file is the calling of the game-exe, nothing more, nothing less.

Yes, I set the working directory!

Aluísio A. S. G.
Offline
Last seen: 7 years 12 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
Working directory?

Try adding the following line to [Launch]:

WorkingDirectory=%PAL:AppDir%\*gamename*

Previously known as kAlug.

Bennieboj
Bennieboj's picture
Offline
Last seen: 5 years 1 week ago
Joined: 2010-09-16 07:28
Thanks, now it works =) Many

Thanks, now it works Smile
Many thanks to all of you for your time!

Yes, I set the working directory!

Log in or register to post comments