Solved

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

Posted on 2009-07-14
11
1,554 Views
Last Modified: 2013-11-14
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
Comment
Question by:bluedragon99
  • 5
  • 5
11 Comments
 
LVL 12

Expert Comment

by:jmcmunn
ID: 24862352

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
 
LVL 12

Accepted Solution

by:
jmcmunn earned 500 total points
ID: 24862549

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
 
LVL 1

Author Comment

by:bluedragon99
ID: 24863005
how do i add/modify the .rul?
0
 
LVL 1

Author Comment

by:bluedragon99
ID: 24863103
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
 
LVL 12

Expert Comment

by:jmcmunn
ID: 24865414

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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:bluedragon99
ID: 24870731
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
 
LVL 12

Expert Comment

by:jmcmunn
ID: 24871584

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
 
LVL 1

Author Comment

by:bluedragon99
ID: 24872178
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
 
LVL 1

Author Comment

by:bluedragon99
ID: 24872292
got it, wasn't using an installscript project type...testing..
0
 
LVL 12

Expert Comment

by:jmcmunn
ID: 24873822

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
 

Expert Comment

by:vDeveloper
ID: 33883634
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
If you don't know how to downgrade, my instructions below should be helpful.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now