Go Back   RunUO - Ultima Online Emulation > Developer's Corner > Programming > C#

C# C# Discussion

Reply
 
Thread Tools Display Modes
Old 02-28-2007, 01:17 PM   #1 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,149
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default how?

I want to make it so that pre-installed software starts up when you turn on your computer.
__________________
Quote:
Originally Posted by Radwen
You should crush your pills and sniff them.
Storm33229 is offline   Reply With Quote
Old 02-28-2007, 03:06 PM   #2 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by Storm33229 View Post
I want to make it so that pre-installed software starts up when you turn on your computer.
Not really sure if this is what you wanted since it isn't c# related but you can simply stick a shortcut for that program in this folder for all the users: @"c:\Documents and Settings\All Users\Start Menu\Programs\Startup\"

Or you can replace "All Users" with "%username%" (with % without ") so it'll run for the current user only.

Again, not c# related but it'll work.
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 02-28-2007, 05:12 PM   #3 (permalink)
Forum Expert
 
Join Date: Jul 2003
Location: Arizona
Age: 18
Posts: 3,149
Send a message via AIM to Storm33229 Send a message via Yahoo to Storm33229
Default

Quote:
Originally Posted by daat99 View Post
Not really sure if this is what you wanted since it isn't c# related but you can simply stick a shortcut for that program in this folder for all the users: @"c:\Documents and Settings\All Users\Start Menu\Programs\Startup\"

Or you can replace "All Users" with "%username%" (with % without ") so it'll run for the current user only.

Again, not c# related but it'll work.
Here's basically what I want to happen:
1) I install software on computer.
2)When you shut down the computer, and reboot, the computer runs the executable file before windows even loads...
__________________
Quote:
Originally Posted by Radwen
You should crush your pills and sniff them.
Storm33229 is offline   Reply With Quote
Old 02-28-2007, 05:47 PM   #4 (permalink)
ConnectUO Creator
 
Jeff's Avatar
 
Join Date: Jan 2004
Location: In your mom
Age: 27
Posts: 4,762
Default

You have to register the exe with the registry startup key.

This is what I did with CUO Desktop.

Code:
		private void SetLoadWithWindows(bool load)
		{
			try
			{
				string regkey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run";
				using( RegistryKey key = Registry.LocalMachine.CreateSubKey(regkey) )
				{
					if( load )
						key.SetValue("cuodesktop", Path.Combine(Paths.ApplicationPath, "CUODesktop.exe"));
					else
						key.DeleteValue("cuodesktop", false);

					key.Close();
				}
			}
			catch
			{
			}
		}
__________________
Jeff Boulanger
ConnectUO - Core Developer

Want to help make ConnectUO better? Click here to submit your ideas/requests
Use your talent to compete against other community members in RunUO hosted coding competitions

If you know XNA (even if its just a little) or are a good artist(2d or 3d) and are interested in making games for a hobby send me a pm or drop by #xna in irc.runuo.com. I'm looking to put together a small game development team.


Please do not pm me for support. If you are having issues please post in the appropriate forum. Thanks for your continued support of both ConnectUO and RunUO
Jeff is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5