installshield 2009, need to add a mandatory reboot upon uninstall (installscript)

I am creating a single image exe in installshield 2009, how would I go about adding a mandatory reboot at the end of an uninstallation?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


Try adding the ScheduleReboot action to your sequence and set the REBOOTPROMPT property to suppress.  If you go to your 'Custom Actions and Sequences' area, then:


You will see it in the list near the bottom.  The condition is likely ISSCHEDULEREBOOT could change it to ISSCHEDULEREBOOT OR REMOVE='ALL'

That 'should' work for you.  You might have to add a custom action that gets run during uninstall that will set the REBOOTPROMPT to be supressed.

Sorry...I misread the type of install you are doing.  I thought Installscript MSI in my head...for an installscript project you can try something like this in your .Rul file.

// OnUninstall
// The OnUninstall event is called when the setup is run with the -uninst
// switch, in this case this is the only event that will be called.
function OnUninstall()
string szIgnore, szMsg;
number nResult;
BOOL bOpt1, bOpt2;
    // Hide the initial progress dialog.
    Disable( DIALOGCACHE );
    // Added in InstallShield 15 - Show an appropriate error message if
    // -uninst is specified and the product is not installed.
    if( !MAINTENANCE ) then
   		SdSubstituteProductInfo( szMsg );
		MessageBox( szMsg, SEVERE );
	// Show Uninstall Confirmation Dialog
	if( MessageBox( SdLoadString( IFX_MAINTUI_MSG ), MB_YESNO ) != IDYES ) then
    // Remove all features.
    // Added in 11.0, disable the cancel button during uninstall.
    if( REMOVEALLMODE ) then
        Disable( CANCELBUTTON );
	// Added in 11.0 - Set appropriate StatusEx static text.
	// Moved in 12.1 - Set before calling Enable( STATUSEX ) to ensure proper product name updating.
    // Show Status
	SetStatusWindow( 0, "" );
	Enable( STATUSEX );
	StatusUpdate( ON, 100 );
    // Uninstall
	nResult = FeatureTransferData( MEDIA );
    // Handle move data error and abort if error occured.
	if( nResult < ISERR_SUCCESS ) then
    // Disable Status
	Disable( STATUSEX );
    /* if you want to reboot immediately call
        the System function as follows: */
        System (SYS_BOOTMACHINE);

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bluedragon99Author Commented:
how do i add/modify the .rul?
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

bluedragon99Author Commented:
got the script imported, can't figure out where to schedule it to run on uninstall...i think installshield was designed by ray charles...

If you got the script into the setup.rul file it should be called whenever a full uninstall is run.  Check this link for some relevant information.  it may be exactly what you are experiencing.  If not, let us know and we'll troubleshoot as best we can.
bluedragon99Author Commented:
couldn't find out where in the interface to edit setup.rul, link looks good couldn't find onmaintbeforeui() function to add reboot either...guess i'm just lost here..

Under 'Behavior and Logic' in the tree of the Installation Designer, there is a node for Installscript.  Then you will see the Setup.rul as one of the files in the project.  Click on it, and you will see some drop downs at the top of the right hand pane.  If you drop the left dropdown down to 'Before Move Data' you will then find the OnMaintBeforeUI as one of the choices in the right dropdown.  Choose it, and it adds a default version to the Setup.Rul, then you can modify it.

Same process for the OnUninstall, but you will find that one under 'Advanced' instead.
bluedragon99Author Commented:
that's the thing, setup.rul is not visible under B&L under files, if i try to add setup.rul it adds setup2.rul (seems it's not showing it for some reason)..
bluedragon99Author Commented:
got it, wasn't using an installscript project type...testing..

If you are not required to use the installscript project type, you could also try it the other way I suggested with the custom action stuff.  But either way should eventually work fine.
I made an MSI package through Install Shield 2009. I dont want to uninstall the file web.config when an uninstall action performed from Add/Remove Programs, only this file should be reside at the installed location.

Any idea?


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.