Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Rollback problem during Uninstall


6 replies to this topic

zazzo77

zazzo77
  • Members
  • 5 posts

Posted 01 July 2005 - 13:00

This is a problem I have not gotten an answer to on the Installshield forum so i thought of trying my luck here.

When I uninstall and press cancel at the moment when it is removing the files, the rollback kicks in and returns the files. My problem is that it doesnt reregister my selfreg files, and leaves them unregistered.

Solution anyone?

My Installshield forum post http://community.ins...ad.php?t=149018

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 02 July 2005 - 20:41

Assuming the InstallExecute sequence is 'normal', I can only think of:

The Selfreg action processes the DLLs in random order, so if they depend on each other (eg. check registrations of dependant DLLs) you should really consider the normal registration method (ProgID, ClassID tables etc.) Reading your community post I understand that one or more DLLs 'enhanced' the self-registration by doing more than the normal registration. However, other issues may occur, eg. the source file is not registered on the target system (IS will report No registration information) or the target system has a corrupt registry (IS will find ProgIDs/ClassIDs that are no longer applicable).

If you knew about the 'Selfreg random order' problem and tried to fix it by writing your own CA for registration/unregistration, you're out of luck: due to a bug in Windows Installer, your rollback CAs are *not* called when the install is canceled (however, they do get called in case of error).

Back to rollback problems: get detailed information by creating verbose logs. Does WI attempt registration at all, if yes does one DLL fail?

Fast solution: disable rollbacks!

zazzo77

zazzo77
  • Members
  • 5 posts

Posted 05 July 2005 - 12:49

Hi thanks for the response.

The dlls in the installation are not dependent of each other so I have to rule out that. And there are so many of them that it feels unlikley that all of them are dependent of another.
I must admitt that I have never used the normal registration method. If I guessed correct registring by tables is pretty static, and I would like to avoid that.

I have an theory about the problem I'm facing, I am hoping that someone can confirm it. When I set a file as selfregister in Devstudio 9 it creates 4 Customactions that seem to have the function of preforming the selfregistration.
The CAs are
ISSelfRegisterCosting
ISUnSelfRegisterFiles
ISSelfRegisterFiles
ISSelfRegisterFinalize

Is it right to presume that if there is a problem with Rollback of CAs these will also fail?

Solution? Is there a Standard Action Selfregister?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 05 July 2005 - 13:36

Selfregistering cannot be rolled back (as described in MSI help). You should use the Class table etc. instead. To do this let InstallShield extract the COM registration information.

zazzo77

zazzo77
  • Members
  • 5 posts

Posted 05 July 2005 - 16:13

Thank you for confirming the answer I have been been afraid of. I sorry for not seeing it when the information was all along in the MSI help. rolleyes.gif

sad.gif Sadly thought i can not use COM extraction to register all of the files. My COM knowledge is pretty limited but it has been explained to me that all of the dlls does not have the proper Com information needed and some alter or create it as the program runs.

So way I see it I have only two way to go.
Get proper COM dlls or remove cancel button before unregistration.
Am I right?

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 July 2005 - 13:47

Third option would be to self register using a custom action that runs after InstallFinalize. After InstallFinalize the instalaltion will not roll back even if it was cancelled.

zazzo77

zazzo77
  • Members
  • 5 posts

Posted 06 July 2005 - 14:36

Yes that is an viable option but I choose to take the easy way out. I removed the cancel button when it was time to unregister. Used this nifty script.

CODE
function RemoveCancelButton(hMSI)
   OBJECT hRecord;
begin
   
set hRecord = MsiCreateRecord(3);
MsiRecordSetString(hRecord,0,"");
MsiRecordSetInteger(hRecord, 1, 2);
MsiRecordSetInteger(hRecord, 2, 0);
MsiProcessMessage(ISMSI_HANDLE, INSTALLMESSAGE_COMMONDATA, hRecord);  //Removes the cancel button

end;


Krueger and Zweitze thanks for the help. biggrin.gif