confuse .exe . rar

Blitz3D Forums/Blitz3D Beginners Area/confuse .exe . rar

Santiworld(Posted 2009) [#1]
hi, i compile a small game...

i put the game.exe inside a winrar file to send by internet.

and the game.exe only works if is open inside the rar.

if i descompress the file game in c:\games\... or another directory...

i have inmediatly MAV..

why a .exe only work inside in .rar file?


Warner(Posted 2009) [#2]
O_o what a strange problem. Suppose the unrar extracts the .exe to a temp folder somewhere. It might be that it for some reason does run from this temp folder, but not from another.
Suggestions could be:
1. There is an older (working) version of the .exe present in the temp folder and WinRar doesn't delete it.
2. Something with user rights that allow you to only run the exe from the temp. folder
3. Files that the .exe depends on are located in the temp. folder.
Look up this temp. folder and find your .exe. Make a backup of it, and then run it. Then manually put the new version there and run it.


GIB3D(Posted 2009) [#3]
I've found that if your .rar file is in with the main directory to your project directory where all you media and stuff are at, then it will use that if it's not in the .rar so you may have to try moving the .rar file to somewhere else and test it... if you haven't already.


Santiworld(Posted 2009) [#4]
any where i place the rar, the .exe file run ok.

now i compile again, and the game works...

i move all files to the main directory game...


for a safe compiler, what is the best recomended?

all in the same directory?

if i open a file.. like car = loadmesh("cars\cars.b3d")

is recomended add something like loadmesh( game-directory + "\car\cars.b3d") ?


_PJ_(Posted 2009) [#5]
If you have an installation setup, such as InnoSetup etc. then, you could read registry entries to get the location of the root program dir, otherwise, and what I pretty much rely on, is to maintain a global directory list such as:

Global RootDir$=CurrentDir$()
Global MediaDir$=RootDir$+"Media\"
Global Documents$=RootDir$+"Documents\"
Global SoundDir$=MediaDir$+"Sound\"

Etc.

Any media loading commands will always have a prefix then, such as:
car = LoadMesh(MediaDir$+"cars\cars.b3d")


It certainly sounds like a weird issue, I think Warner may e right except for the first insdtance, as I think on each usage of Winrar should open a NEW temporary folder, regardless of whetherr there's an existing one.