This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Please help: Rollback installation after moving data
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2010
12:49 AM
Please help: Rollback installation after moving data
Hi there,
I'm trying to make a installation package for a product. After moving data, I need to add some customized work and configurations. For example, creating a database, etc. So I create an Installscript MSI project. And I added my customized things in the event OnFirstUIAfter().
I'd like to rollback (or you can say Uninstall) the installation if my customized things failed (for example, error occurs when creating a database): All data which have been copied to disk should be removed. And all records of this product (in registry and other places) should be cleaned up too.
I tried to add some codes as below but seems they did not work. With debug mode, I saw every line is walked but nothing happened. Can anyone help me out? Thanks a lot!
if (createDB() < 0) then
// Uninstall the application
FeatureRemoveAll();
FeatureTransferData(MEDIA);
abort;
endif;
I'm trying to make a installation package for a product. After moving data, I need to add some customized work and configurations. For example, creating a database, etc. So I create an Installscript MSI project. And I added my customized things in the event OnFirstUIAfter().
I'd like to rollback (or you can say Uninstall) the installation if my customized things failed (for example, error occurs when creating a database): All data which have been copied to disk should be removed. And all records of this product (in registry and other places) should be cleaned up too.
I tried to add some codes as below but seems they did not work. With debug mode, I saw every line is walked but nothing happened. Can anyone help me out? Thanks a lot!
if (createDB() < 0) then
// Uninstall the application
FeatureRemoveAll();
FeatureTransferData(MEDIA);
abort;
endif;
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 21, 2010
09:28 PM
Does anyone have any suggestions? Thanks in advance.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 18, 2010
09:19 AM
I need to know about this for a similar situation. I know that you won't need the also call to FeatureTransferData.
Sometimes I have used FeatureRemoveAllInMediaAndLog when FeatureRemoveAll hasn't removed everything.
However, I would also like to know more about rollback.
Sometimes I have used FeatureRemoveAllInMediaAndLog when FeatureRemoveAll hasn't removed everything.
However, I would also like to know more about rollback.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Feb 22, 2010
08:01 AM
I think you're basic issue is going to be that, in an InstallScript MSI project, the OnFirstUIAfter event comes after the MSI portion of the installed is finished. That is, Windows Installer has been called and has installed the components and has closed the database.
You might be able to do what you want with a pure InstallScript project, or you might be able to do it with an MSI with custom actions (and associated rollback custom actions), but I don't think you're going to be successful trying to uninstall the MSI part of an InstallScript MSI project with InstallScript events.
You might be able to do what you want with a pure InstallScript project, or you might be able to do it with an MSI with custom actions (and associated rollback custom actions), but I don't think you're going to be successful trying to uninstall the MSI part of an InstallScript MSI project with InstallScript events.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)