| View previous topic :: View next topic |
| Author |
Message |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 19, 2007 2:18 pm Post subject: [Delphi] A question |
|
|
Hey.
I want my delphi program to run a .exe file from Programs and Files.
But since theres a lot different Programs and files folders, like Programmer (in my case).
Is there some code thats made for Programs and Files?
I hope you understand what I mean.
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Mon Nov 19, 2007 2:28 pm Post subject: |
|
|
Programs and file or Program Files?
All you have to do is load the exe, I don't think you will have the same name for an exe (or is the problem it takes to long to find it?)
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 19, 2007 2:30 pm Post subject: |
|
|
Well, Im gonna make a launcher for WoW.
So it has to go to C:\Programs and Files\World of Warcraft\.
But theres different folders, in my case its.
C:\Programmer\World of Warcraft\.
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Mon Nov 19, 2007 2:33 pm Post subject: |
|
|
do a recursive search for WoW.exe on all drives
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 19, 2007 2:39 pm Post subject: |
|
|
| appalsap wrote: | | do a recursive search for WoW.exe on all drives |
Wouldnt that be kinda stupid when its a launcher?
If you have to search for the WoW.exe all the time you start the launcher.
But if thats a good way, you got any code?
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Mon Nov 19, 2007 2:41 pm Post subject: |
|
|
How bout you use common dialog to let the user choose the exe?
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 19, 2007 2:42 pm Post subject: |
|
|
World Of Warcraft is an installed game which usually leads to having install paths and such stored in the registry (at the same location for everyone) that will point to the path of the game. You could try using that instead.
_________________
- Retired. |
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 19, 2007 2:42 pm Post subject: |
|
|
Please explain some more
Ive just come from VB6 to Delphi. Heh
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Mon Nov 19, 2007 2:44 pm Post subject: |
|
|
Or you can make a document (text document) and have them put in a url and just load it, although it will look awkward
I can help you do common dialog with vb6, not delphi though
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Mon Nov 19, 2007 2:45 pm Post subject: |
|
|
That could be an idea .
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Mon Nov 19, 2007 2:50 pm Post subject: |
|
|
If your project has an installer to it, you could have the user specify the path of their installed WoW, and then have it save in a file for later use (such as loading the game, and it could be edited easily with notepad if the user changed directories)
_________________
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Mon Nov 19, 2007 3:02 pm Post subject: |
|
|
| Blader wrote: | | If your project has an installer to it, you could have the user specify the path of their installed WoW, and then have it save in a file for later use (such as loading the game, and it could be edited easily with notepad if the user changed directories) |
No need to get that nuts lol. Can just use an ini or another style of a configuration file (xml, cfg, etc.) and have the user define the path inside it. You can create a GUI to point to the location and save it into that file as well.
I suggest you take a look into your registry though before taking extreme measures as I can almost guarantee you the install path for a game such as WoW should be there.
_________________
- Retired. |
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Mon Nov 19, 2007 3:04 pm Post subject: |
|
|
Hehe
It's easier then looking inside the registry o.o
_________________
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Mon Nov 19, 2007 3:43 pm Post subject: |
|
|
Or, make it a Dynamic launcher:
Give it three forms:
Main,
Config,
Launcher
~~
Main - contains buttons to pop up the Config, and the Launcher; this runs on startup
~~
Config - from here, the user specifies which programs he/she wants to run, and the respective directories; the Config will write these out to an INI file:
| Code: |
WOW.exe C:\Programmer\World of Warcraft
Freecell.exe C:\Windows\System32
|
~~
Launcher - there is a button, and a table which has two columns, an exe name, and a path; when the form loads, it opens up the .ini file (if it exists), and reads in the data; the button launches the application respectively selected in the table
~~
As a programmer, you should know exactly what you want to do. That should help you out.
|
|
| Back to top |
|
 |
rapion124 Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Mar 2007 Posts: 1095
|
Posted: Mon Nov 19, 2007 4:13 pm Post subject: |
|
|
| Add 'Registry' to your uses list. Use the system registry to find where the file is installed. Or, you can use an open dialog and let the user search for the file. Then, add ShellAPI to your uses list. Use ShellExecute() to start the program using SW_SHOW as the last flag.
|
|
| Back to top |
|
 |
|