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
- :
- Re: Rollback after failed self register.
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
‎Mar 20, 2009
05:01 AM
Rollback after failed self register.
Hi all,
I have a self register dll.
The roll back is not triggered if the registration fails.
Is there a way to trigger rollback on registration failure?
Regards
Vlad
I have a self register dll.
The roll back is not triggered if the registration fails.
Is there a way to trigger rollback on registration failure?
Regards
Vlad
(12) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 20, 2009
06:19 PM
How are you registering the DLL? Better yet, is there a way to avoid the registration failing? (In what way does it fail?)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 21, 2009
02:45 AM
Hi,
I am using self register method on BasicMSI project.
It was failing because of one missing dll in the package.
It is fixed now, but what if self-register fails for some other reason?
Isn't it better to rollback the installation? It will not be functional application if the registration is failed, so IMO it should be rollbacked, correct?
Regards
Vlad
I am using self register method on BasicMSI project.
It was failing because of one missing dll in the package.
It is fixed now, but what if self-register fails for some other reason?
Isn't it better to rollback the installation? It will not be functional application if the registration is failed, so IMO it should be rollbacked, correct?
Regards
Vlad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 21, 2009
10:14 PM
It's better to not use self registration in the first place. It's a legacy anti-pattern that isn't a best practice.
Think about it for a moment. Instead of using data driven standard actions that richly describe the exact registration requirements, your trusting fragile third party, out of process code to do the job. Windows Installer has no idea what this code is going to do. If this code fails, just how do you expect MSI to clean it up? Call DllUnRegisterServer() and hope that doesn't fail also? And let's say a previous component had been installed and you want to get it's registration data back. Hope the the new controls DllRegisterServer() will handle this also?
It's all crap and there's a reason that you should use the COM/Registry tables instead of doing SelfReg.
Or better yet, stop using COM altogether. 🙂
Think about it for a moment. Instead of using data driven standard actions that richly describe the exact registration requirements, your trusting fragile third party, out of process code to do the job. Windows Installer has no idea what this code is going to do. If this code fails, just how do you expect MSI to clean it up? Call DllUnRegisterServer() and hope that doesn't fail also? And let's say a previous component had been installed and you want to get it's registration data back. Hope the the new controls DllRegisterServer() will handle this also?
It's all crap and there's a reason that you should use the COM/Registry tables instead of doing SelfReg.
Or better yet, stop using COM altogether. 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 22, 2009
02:55 AM
Hi,
Thanks, sounds reasonable.
So what is the proper way to register dll-s?
Regards
Vlad
Thanks, sounds reasonable.
So what is the proper way to register dll-s?
Regards
Vlad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2009
05:20 PM
Please see the help topics under Creating Installations > Organizing Files... > Registering COM Servers to learn more about your options.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2009
05:32 PM
Another option is to create a custom action that launches an executable and for the Filename & Command line value, enter
regsvr32.exe /s "[PATH_TO_FILE]fileToRegister.dll"
The /s option makes it silent, suppressing any message boxes.
regsvr32.exe /s "[PATH_TO_FILE]fileToRegister.dll"
The /s option makes it silent, suppressing any message boxes.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2009
05:42 PM
For the reasons Chris mentions (no rollback or uninstall, possible trouble with dependencies, and more), using regsvr32.exe falls into the bin of last-resort registration techniques. There's even an InstallShield best practice rule (ISBP12) that will show a warning if an action appears to use regsvr32...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2009
05:53 PM
Thanks for the info, Robert. I actually have tried to use COM extraction in the past, but it didn't quite work for me because of a sequencing or race condition or something. So I have the following CAs in my project:
1. a deferred CA that calls regsvr32
2. a corresponding rollback CA for #1 that runs regsvr32 with the /u flag to unregister it
3. a deferred CA that calls regsvr32.exe with the /u flag during uninstallation
4. a corresponding rollback CA for #3 that runs regsvr32 to register it
1. a deferred CA that calls regsvr32
2. a corresponding rollback CA for #1 that runs regsvr32 with the /u flag to unregister it
3. a deferred CA that calls regsvr32.exe with the /u flag during uninstallation
4. a corresponding rollback CA for #3 that runs regsvr32 to register it
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2009
06:24 PM
Fair enough, but in the fullness of time figuring why the COM extraction doesn't work might be worthwhile. (The features are a bit more obscure/reviled, but using regsvr32 also doesn't play well with MSI advertisement, per-user or -machine registration, relative paths, ...) Was there an error, or did extraction just freeze, or ...?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 24, 2009
07:19 PM
Yes, I would much rather use COM extraction over regsvr32. It's been over a year since I last tried using COM extraction (again), but the error wasn't during the extraction which worked fine, rather during installation and/or installation of the product. I was looking through my version control logs, and the two times that I switched to using COM extraction resulted in problems using our product (during our development cycle), so I reverted back to using regsvr32 both times. I'll have to take a more in-depth look at it at some point.
Thanks again, Robert.
Thanks again, Robert.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 26, 2009
03:36 AM
Thanks all,
finaly I used two custom actions:
RegisterAddin
# Name: RegisterAddin
# DLL Keyfile: Adxloader
# Function Signature: (Name: DllRegister, Type: HANDLE, Source: Constant, Value: MsiHandle, Return Value: Void) # Inscript Execution: Deferred # Install Execute Sequence: AfterSelfRegModules # Install Exec Condition: Not Installed
UnregisterAddin
# Name: UnregisterAddin
# DLL Keyfile: Adxloader
# Function Signature: (Name: DllUnregister, Type: HANDLE, Source: Constant, Value: MsiHandle, Return Value: Void) # Inscript Execution: Immediate Execution # Install Execute Sequence: AfterSelfRUnegModules # Install Exec Condition: Installed
finaly I used two custom actions:
RegisterAddin
# Name: RegisterAddin
# DLL Keyfile: Adxloader
# Function Signature: (Name: DllRegister, Type: HANDLE, Source: Constant, Value: MsiHandle, Return Value: Void) # Inscript Execution: Deferred # Install Execute Sequence: AfterSelfRegModules # Install Exec Condition: Not Installed
UnregisterAddin
# Name: UnregisterAddin
# DLL Keyfile: Adxloader
# Function Signature: (Name: DllUnregister, Type: HANDLE, Source: Constant, Value: MsiHandle, Return Value: Void) # Inscript Execution: Immediate Execution # Install Execute Sequence: AfterSelfRUnegModules # Install Exec Condition: Installed
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 26, 2009
08:15 AM
Good luck with that.
