Index: setup/threebar.cc
===================================================================
--- setup/threebar.cc	(revision 1105)
+++ setup/threebar.cc	(working copy)
@@ -31,6 +31,9 @@
 
 #include "ControlAdjuster.h"
 
+#include "io_stream_file.h"
+#include "msg.h"
+
 /*
   Sizing information.
  */
@@ -208,6 +211,12 @@
       }
     case WM_APP_POSTINSTALL_THREAD_COMPLETE:
       {
+        if ( io_stream::exists ("cygfile:///etc/setup/reboot") ) {
+          io_stream::remove("cygfile:///etc/setup/reboot");
+          log (LOG_TIMESTAMP) << "A script detected that a reboot is due" << endLog;
+          note (GetHWND(), IDS_REBOOT_REQUIRED);
+        }
+
 	// Re-enable and "Push" the Next button
 	GetOwner ()->SetButtons (PSWIZB_NEXT);
 	GetOwner ()->PressButton (PSBTN_NEXT);
Index: utils/dllupdate.cpp
===================================================================
--- utils/dllupdate.cpp	(revision 1105)
+++ utils/dllupdate.cpp	(working copy)
@@ -39,11 +39,11 @@
 /************************************************************************/
 
 int main( int argc, char **argv )
-
 {
     bool        bQuiet = false;
     bool        bOnlyIfTargetExists = false;
     bool        bDoCopy = false;
+    bool        bNotifyReboot = false;
     const char *pszSourceDLL = NULL;
     const char *pszTargetDir = NULL;
     char        szTargetDLL[2048] = "";
@@ -66,6 +66,9 @@
         else if( strcmp(argv[i],"-copy") == 0 )
             bDoCopy = true;
 
+        else if( strcmp(argv[i],"-reboot") == 0 )
+            bNotifyReboot = true;
+
         else if( argv[i][0] == '-' )
             Usage();
 
@@ -209,7 +212,6 @@
                      "schedule %s to be renamed on reboot have failed.\n",
                      szTargetDLL, szTempTargetDLL );
             exit( 1 );
-                     
         }
 
         if( !bQuiet )
@@ -219,6 +221,36 @@
                     szTargetDLL, szTempTargetDLL );
         }
 
+        if( bNotifyReboot )
+        {
+            char *pszDir = getenv("OSGEO4W_ROOT");
+            if( pszDir )
+            {
+                char szEtcReboot[2048];
+                FILE *fp;
+
+                sprintf(szEtcReboot, "%s\\etc\\setup\\reboot", pszDir);
+                fp = fopen(szEtcReboot, "w");
+                if( !fp )
+                {
+                    fprintf( stderr, "Could not create file %s\n", szEtcReboot );
+                    exit( 1 );
+                }
+
+                fclose(fp);
+            }
+            else
+            {
+                fprintf( stderr, "Environment variable OSGEO4W_ROOT not set\n" );
+                exit(1);
+            }
+
+            if( !bQuiet )
+            {
+                printf( "Installer was notified that a reboot is due.\n" );
+            }
+
+        }
         exit( 0 );
     }
 
@@ -243,8 +275,9 @@
             " -q: quiet\n"
             " -oite: only copy if target dll exists\n"
             " -copy: enable copy/update (default is info only)\n" 
+            " -reboot: create %%OSGEO4W_ROOT%%/etc/setup/reboot if the update needs a reboot\n" 
             " source_dll: The full path to the source dll\n"
-            " target_directory: path to target dir, default is C:\\windows\\system32\n" );
+            " target_directory: path to target dir, default is %%WINDIR%%\\system32\n" );
     exit( 1 );
 }
 

