• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1929
  • Last Modified:

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?
0
bluedragon99
Asked:
bluedragon99
  • 5
  • 5
1 Solution
 
jmcmunnCommented:

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:

Sequences->Installation->Execute

You will see it in the list near the bottom.  The condition is likely ISSCHEDULEREBOOT currently...you 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.
0
 
jmcmunnCommented:

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;
begin
 
    // 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
		szMsg = SdLoadString( IDS_IFX_ERROR_PRODUCT_NOT_INSTALLED_UNINST );
   		SdSubstituteProductInfo( szMsg );
		MessageBox( szMsg, SEVERE );
		abort;
    endif;
	
	// Show Uninstall Confirmation Dialog
	if( MessageBox( SdLoadString( IFX_MAINTUI_MSG ), MB_YESNO ) != IDYES ) then
        abort;
    endif;
 
    // Remove all features.
	FeatureRemoveAllInMediaAndLog();
 
    // Added in 11.0, disable the cancel button during uninstall.
    if( REMOVEALLMODE ) then
        Disable( CANCELBUTTON );
    endif;
    
	// Added in 11.0 - Set appropriate StatusEx static text.
	// Moved in 12.1 - Set before calling Enable( STATUSEX ) to ensure proper product name updating.
    SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) );
 
    // 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
		OnComponentError();
		abort;
	endif;
 
    // Disable Status
	Disable( STATUSEX );
 
    /* if you want to reboot immediately call
        the System function as follows: */
        System (SYS_BOOTMACHINE);
end;

Open in new window

0
 
bluedragon99Author Commented:
how do i add/modify the .rul?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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...
0
 
jmcmunnCommented:

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.

http://community.acresso.com/archive/index.php?t-115314.html
0
 
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..
0
 
jmcmunnCommented:

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.
0
 
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)..
0
 
bluedragon99Author Commented:
got it, wasn't using an installscript project type...testing..
0
 
jmcmunnCommented:

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.
0
 
vDeveloperCommented:
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?

Thanks

Mazhar
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now