Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

OnRebooted


9 replies to this topic

SLadd

SLadd
  • Members
  • 6 posts

Posted 10 January 2003 - 20:46

I am trying to use the OnRebooted function. After my installation is done and I reboot the system, it doesn't call the OnRebooted function.  I seem to be missing the link between the end of the installation and the restart of the setup.  Can anyone help?

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 10 January 2003 - 22:01

I've never had that problem.  What are you trying to do in the the function?  The function is run before the desktop is kicked off, so that may be creating some problems for you.

I once tried to start MSDE (that my installer installed) from the on rebooted function, but couldn't because it wasn't really available when that function was run.  I ended up adding a batch file to the the Start-up item.

Let me know what you're trying to do and maybe I can be of more help
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

SLadd

SLadd
  • Members
  • 6 posts

Posted 13 January 2003 - 14:17

I am trying to run an executable that updates and links our databases.  I can not do it in OnEnd due to locked files.  

I am doing the following in OnRebooted:
OnRebooted()
begin
UpdateDatabases();
end;

I have tried to just bring up a MessageBox in OnRebooted() and even that doesn't work.  Am I missing something?

Thanks for your help

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 13 January 2003 - 17:04

My guess would be the database engine hasn't started yet, and therefore you can't really update anything.  (See my last post about MSDE).

They way I worked around this problem was kicking off thing from the Windows start-up function.

You could add the exe to the Start-up folder under the RESOURCES tab (RESOURCES/Shell Objects/Start Menu/Programs/Start-up) and windows will launch the exe every time you start the desktop.

Now, if you only want it run once, have the exe remove itself from the start-up folder of Windows.  If you need help with this let me know and I can give you a few examples of how to do this different ways.

Let me know if this helps you, or if you have any other questions.
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 13 January 2003 - 17:46

Well timing wouldn't apply to a simple message box, but definitely makes sense for what he's really trying to do here.
user posted image

Xitch13

Xitch13
  • Members
  • 134 posts

Posted 13 January 2003 - 17:54

Actually, the Windowhandler probably isn't launched until the desktop is launched, so trying to pop-up a window would also fail.  At least that's what I assumed when it failed for me too, b ack when I was trying to launch MSDE :)
There is great chaos under heaven, and the situation is excellent. (Mao Tse Tung)

SLadd

SLadd
  • Members
  • 6 posts

Posted 13 January 2003 - 21:16

I was able to do this exact function in OnRebooted in a prior project and it worked fine, but I just discovered that it does not work on my development machine which has many things going on during the desktop startup.  Can you give me an example of how you worked around this problem by adding  a batch file to the the Start-up.  I would want this to execute only once.  Thanks



SLadd

SLadd
  • Members
  • 6 posts

Posted 14 January 2003 - 21:45

Thanks for your help...  I put the exe in the Start up folder and it works great.  It really only needs to be run once, but not harm is done if it runs every time.

hambone

hambone
  • Members
  • 206 posts

Posted 15 January 2003 - 16:23

you could also place a reference to the .EXE/.BAT/.CMD file into one of the RunOnce keys in the registry.  

there are about ten of these areas that offer different options...  the most commonly used and recommended is the

"HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce"
( to execute programs that run silently ) and

"HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce\Setup" key ( for programs that run synchronouly... )

SLadd

SLadd
  • Members
  • 6 posts

Posted 16 January 2003 - 18:18

I decided to use the RunOnce in the registry.  That works great.  Thanks for all your help. :D  :)