Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Windows / Running an AGK App from the AppUp Client

Author
Message
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 26th May 2012 16:57
Hi everyone. I've being trying to port my simple Abacus App to the AppUp Store and I've got it all compiled and packaged. However I've had trouble actually running it through the AppUp client. What happens is this. I can download it directly in the AppUp client. Once downloaded, there are three ways to launch the app. One is to find where AppUp has put it on the disk and run the exe, one is to launch it from the desktop icon and one is to launch it from the "Launch" button inside the AppUp client itself. Both of the first two methods run the app fine but if I try and launch the app from within the AppUp client, I get the following error:

Quote: "Failed to open file for reading C:\Users\Laurie\Documents\AGK\C_ProgramFiles(x86)_TezcatlipocaSoftware_abacus_abacusexe\abacus.byc at line 0"


I reported this as a bug here but Lee assured me that it is not. However I could not understand his explanation for, as I have said, launching it from outside of the AppUp client works fine. Therefore there cannot be any issue with the bytecode file. I considered whether this might be a permissions issue but having tried running the client as an administrator, I have had the same problem. I have tested this on two machines (a Windows XP SP3 netbook and a Windows 7 HP SP1 x64 laptop) and got the exact same result.

So my questions are:
1. Has anyone actually yet managed to publish an AppGameKit app to the AppUp store?
2. Has anyone else encountered this error?
3. Does anyone know/have any suggestions about how I might be able to fix this?

Thanks for your help!

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th May 2012 01:24
Quote: "Has anyone else encountered this error?"

I've encountered the error but not in the same situation that you have. I got the error when the application couldn't find the corresponding .byc file. My .bycs are located in the Media folder but it appears that your's isn't? I'm not sure if all of the packaging changes that though.

It is strange that executing via a double click works but not from the appup client.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 27th May 2012 09:44
Quote: "It is strange that executing via a double click works but not from the appup client."

Exactly. Because of course you a right, the error is telling me that the bytecode file is not in the media file. However if I navigate to the media file on the disk, I can see that it is there and what's more, the app knows it's there too when I launch it from the desktop. When I say I launch it from the desktop, I mean I launch the version that was installed by AppUp. So I can't believe that the packaging has anything to do with it. Most puzzling indeed! Anyhow thanks for he thoughts. Any more ideas and suggestions most welcome.

If anyone wants to test what I mean with this app and is on Intel AppUp, I can always share it with you as a beta tester.

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 27th May 2012 10:31
What if you copied the .byc file to the path specified in the error message?

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 27th May 2012 13:48 Edited at: 27th May 2012 13:52
Quote: "What if you copied the .byc file to the path specified in the error message?"

If you do that, then the error message changes to claim that the first bit of media that you try and load isn't in the media folder. This is what made me think it was a permissions error because when launched through the client, it just doesn't seem to be able to see any of the media in the media folder. I think it was baxslash that suggested it might be some issue with the initial file path set when launched from the client or something but in that case, it would surely be a bug. If you put ALL the media into that folder (and I'm not sure how you would get the msi to do that anyway) but even if you do, you then get problems when your code tries to read/write data files.

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 28th May 2012 12:29
Very interestingly, whilst developing a game for the snake comp (and after upgrading to 1075) I noticed that if I launched the game from the IDE just after I compiled it, it would crash. But, if I then ran it again from the IDE, it would run. My game would also run from going into the project folder and double clicking. There could be a connection. I'll experiment further with this when I have the time. We may have to make use of the SetFolder() command (formerly setCurrentDir() ).

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 28th May 2012 14:30
Quote: "after upgrading to 1075) I noticed that if I launched the game from the IDE just after I compiled it, it would crash"

Very interesting. Thanks for letting me know about this. Just to clarify, this game is compiled with v1065. I'll try and do some more testing if I get the chance. Keep me posted of how any of your experiments go.

Norm
11
Years of Service
User Offline
Joined: 29th May 2012
Location:
Posted: 30th May 2012 00:59
AppUp will always launch apps in the default AppUp store directory folder: Crograms File\Intel\IntelAppStore\bin.

As a result it appears your app can't seem to find the needed files to run. Thus it won't launch from the store but it will run from the desktop.

Essentially, in your code you should do this
CString path = " C:\Program Files\App Folder ";
SetCurrentDirectory(path);

Here is a link on how to set the current directory.
http://msdn.microsoft.com/en-us/library/aa363806(v=vs.85).aspx

Also, can you ask them if you are calling the function LoadLibrary() or trying to set a path to a resource file/files location? If so, please ask them to set the full path of the file when they pass in the parameters.

Typically some developer use relative paths in the code such as \\AppFolder\\ResourceFolder\\sound.wav. Instead you should use the following: C:\\Program Files\\AppFolder\\ResourceFolder\\sound.wav
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 4th Jun 2012 00:34
Hey Norm. Thanks for for info on this. It's very interesting to know what may be causing this problem. However I still see a few problems here with your solution...

First off, surely the lines



Will never run because AppGameKit can't find the bytecode file in which those commands would be. Also as I use Tier 1, I don't have access to the functions at the link you gave. In addition, I'm not really happy with having to set the literal address like you suggest because even if I could work out where the program files directory is without those commands, it would kind of stop it from being really cross platform.

One other thing that puzzles me is that I already have a game on Intel AppUp and all the addresses given in that are relative but that does not suffer from the same problem and is able to load all the media.

Anyhow thanks for your help with this. I'll try and have another look and see what I can work out.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2012 00:57
SetCurrentDirectory is a command available in Tier1. But is now deprecated in favor of SetFolder.

Having said that, I have had problems with both commands. I will be creating a sample project to illustrate the issues after I test them some more.

In Tier1, it won't execute any of your commands until it loads the bytecode file. So, as long as you put it in the media directory, your app will run. And theoretically, you can set the directory for files after the bytecode file has started. On the very first line of your main.agc file, if you want.

I'm of the opinion that you are safer using all the default locations. The only issues come when you try to create your own files. Then they default to wherever the platform it is running on puts user defined files. Which varies and should not be set in stone in your code unless you plan to publish on only one platform.

And certainly trying to set the folder to the computer-wide application folder is a huge no-no. That is outside the scope of the executable program and not where user files go.

Cheers,
Ancient Lady
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 4th Jun 2012 09:43
Hi AL. Thanks for your input on this.

Quote: "In Tier1, it won't execute any of your commands until it loads the bytecode file. So, as long as you put it in the media directory, your app will run."

You see, this is precisely the problem. The app cannot find the bytecode file when it is in the media directory when launched from within the AppUp client; presumably for the reasons Norn outlined. Thus, it can't execute the SetCurrentDirectory command (with or without glitches).

Quote: "One other thing that puzzles me is that I already have a game on Intel AppUp and all the addresses given in that are relative but that does not suffer from the same problem and is able to load all the media."

I was thinking about this after I said it and I realised that in fact, my other app (which is written in DBP) packages most of the media inside itself so maybe this is why it avoid the problem. That said, there are one or two things outside itself in it own root directory and subdirectories which it is still able to make use of so I'm not sure this entirely explains it..

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Jun 2012 17:05
Lucas, you are right. I misread your post.

After reading the comments in the google post, it looks like it is basically an AppUp issue. It appears to try to copy everything to the users' directory. I think this is what is meant by sand boxing an app. But it doesn't create the media directory and keep the hierarchy of the original program when run within AppUp.

I'm not sure there is a way around this.

Personally, I plan to sell any windows based games directly. It sounds like AppUp doesn't play well with others.

Cheers,
Ancient Lady
Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 4th Jun 2012 19:13
Quote: "It sounds like AppUp doesn't play well with others."

Indeed. However in the AppGameKit documentation under guides, there are instructions for publishing with AppUp so I assume that it is possible.. I wonder if there would be some way of adding the codes Norm mentioned to the AppGameKit Interpreter that we have to compile our bytecode with. I've not been able to work out what that would be but I'll have a look. The interpreter must load the bytecode file so if I can find where it does that, maybe it would be possible to change the current directory before it does.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 6th Jun 2012 00:44
Hi again. Sorry for the double post. Just wanted to say that having played around with trying to set the directory in the interpreter code, I've had no luck with fixing the problem. Maybe I'm just being dense here but I've tried lines like these:



in all kinds of different places in the code and it seems to have little effect. So I guess the search for a solution goes on. I'll post again if I have any breakthroughs but to be honest, I'm not quite sure what to try next...

mr_d
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 16th Jun 2012 11:50
Hi Lucas, as mentioned in another thread that you responded to, I just wanted to inform you that my game Rogue Robot Rampage was created using AppGameKit Tier 1 and I was able to successfully create and package it on AppUp using the instructions for creating my own interpreter.
What Norm and Ancient Lady said about paths seem to be the underlying problem here. Just make sure that in the Core.cpp file the part where it sets the current folder to the application folder (lines 544 to 555 in my version), and whre it sets the current folder to the media folder (line 584 in my version) are there and un-commented (can't remember if this was the default or not).
Also in interpreter.cpp, the same again on line 2980 and 2984 respectively. The only other thing to take extra note of if to change the interpreter name to be the exact same name as your application as they indicate in the instructions.
Please note that I did this with the version of AppGameKit that was current in January 2012, so the files may have changed since then.
Hope this info helps you our at least a little bit. Cheers.

Lucas Tiridath
AGK Developer
15
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 16th Jun 2012 13:16
Hey Mr. D. Thanks for the suggestions. Do I feel silly now! OK so the problem was that although all the lines you mentioned were uncommented, the ones in Core.cpp appeared within preprocessor directives and they appear not to have been activated so the code inside them, which included both setting the directory and verifying the launch with AppUp, were not actually being compiled into the final version. This was causing the problem. I don't know quite why they were not working, presumably something to do with my setup, but I avoided the problem simply by commenting out the #ifdefs and it now appears to run fine.

Thanks very much for helping me resolve this!

mr_d
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 16th Jun 2012 14:00
No Problem Lucas, glad you were able to get it working!

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 17th Jun 2012 03:01
I dropped by to say that I think I've finally got my AppUp stuff working so I can beta test but when I get here, everything is solved! Glad everything is sorted out.

Login to post a reply

Server time is: 2024-04-16 14:49:24
Your offset time is: 2024-04-16 14:49:24