View Full Version : New to the program, quick question.
Algebra
10-31-2005, 06:48 PM
This is probably easy as peeing in bed, but I made a splash screen that comes up at automatically when the CD is inserted. On that splash screen, I have a button that when clicked, should open a URL file that is on the CD. My question is, how do I make it so that the file that is opened and all the link information is intact regardless of the machine that the CD is run on?
When I create the 'on click' action, i type in the path of the file from its original location on my hard drive. Obviously, after I make the CD and test it, it works. When I go to another computer, the drive letter doesn't exist on that computer, so it doesnt find it. Perhaps there is a wildcard I need to use for the drive letter so it defaults to the users CD rom drive and all links pull from that particular drive letter so my CD website is displayed correctly with all the correct links and pictures, etc.
Hope I have been specific enough.
rhosk
10-31-2005, 06:59 PM
Use -
_SourceDrive .."\\your path\\file.htm"
Algebra
11-01-2005, 12:35 AM
I don't quite understand.
Can I copy and paste what you wrote?
rhosk
11-01-2005, 03:42 AM
That's just it Algebra, if you post 'your' code, then we may be able to correct it. Not knowing exactly what you used, it's hard to give you details.
Post the code you used that's not working and provide as much background detail as you can, we'll get it working for you :)
TJ_Tigger
11-01-2005, 08:03 AM
AMS has a built in global function that allows you to specify a path to files contained on the CD by calling _SourceFolder. That global variable can be concatenated to the remainder of your path to be able to reference any files on the CD no matter what the drive is labled.
HTH
Algebra
11-01-2005, 10:22 PM
File.OpenURL("H:\flair\cd_catalog\index.html", SW_SHOWNORMAL);
The above is the code that is put in when I do the wizard for the action.
How should that code look in order to have it do what I need?
Corey
11-01-2005, 10:33 PM
Hi, you just need to "escape" your backslashes, which means adding a backslash to each one. So this code should work:
File.OpenURL("H:\\flair\\cd_catalog\\index.html", SW_SHOWNORMAL);
:)
Algebra
11-01-2005, 11:36 PM
Hi, you just need to "escape" your backslashes, which means adding a backslash to each one. So this code should work:
File.OpenURL("H:\\flair\\cd_catalog\\index.html", SW_SHOWNORMAL);
:)
Thanks for the tip, but it didn't work. I put in that code with the double backslashes and saved and burned my CD. Then I disabled my LAN connection so that the 'H' drive could not be gotten to since it is not local to my PC and I get no action on that button.
Corey
11-01-2005, 11:48 PM
Hi. You could always change "H" to a drive which contains your file and is accessible to your application I guess. The action can only execute if the drive and file exist, and are accessible to the application/script. :yes
Algebra
11-02-2005, 12:39 AM
Hmmm...I understand where you're coming from, however, in order for the finished CD to be viable to my purposes, it has to be universally accessable to anybody who plays it in a Windows based PC so initial drive letters could be different.
So, right now the button wants to execute a file located on an 'H' drive. On a local PC the file in question would be on the CDRom drive, drive 'D' for most, but of course it varies. In the earlier posts, they said I need a command called "_Sourcedrive" or "_Sourcefolder". I guess what I need to know is, what would my syntax be using one of those two commands?
Corey
11-02-2005, 01:04 AM
File.OpenURL(_SourceDrive.."\\flair\\cd_catalog\\index.html", SW_SHOWNORMAL);
or
File.OpenURL(_SourceFolder.."\\flair\\cd_catalog\\index.html", SW_SHOWNORMAL);
_SourceDrive points to the drive your AutoPlay project is run from, _SourceFolder points to the folder your AutoPlay project is run from. :yes
Algebra
11-02-2005, 02:52 AM
WORD!
Thanks to you all.
Corey
11-02-2005, 03:12 AM
Cheers. :)
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.