How to unregister then reregister file during install
| Article:HOWTO6328 | | | Created: 2005-10-18 | | | Updated: 2010-06-22 | | | Article URL http://www.symantec.com/docs/HOWTO6328 |
Question
How would I unregister a .DLL and then reregister it during installation?
Answer
In the Windows Installer Editor of Wise Package Studio or Wise for Windows Installer:
- Open the Setup Editor.
- Select the Tables tab
- Click on the File table and locate the .DLL you are trying to register. Note of the component name listed in the component column for that file.
- Click on the Component table and find the component. Note of the directory name listed in the Directory_ column for that component. The instructions below assumes that this value is INSTALLDIR.
In the MSI Script, follow the steps below:
- In the Execute Immediate sequence, add a Execute Program from Destination custom action after InstallFinalize. The Execute Program from Destination dialog appears.
- Fill in the following information:
- Custom Action Name: UnregisterDLL
- Working Directory: Browse for System32
- EXE and command line: [SystemFolder]Regsvr32.EXE /U "[INSTALLDIR]TEST.DLL"
- Click OK.
- Add a second Execute Program from Destination custom action immediately after UnregisterDLL. The Execute Program from Destination dialog appears.
- Fill in the following information:
- Custom Action Name: RegisterDLL
- Working Directory: Browse for System32
- EXE and command line: [SystemFolder]Regsvr32.EXE "[INSTALLDIR]TEST.DLL".
- Click OK.
- Add an If Statement right before the UnregisterDLL custom action. The If Settings dialog appears.
- Enter "NOT Installed" in the Condition field.
- Click OK.
- Add an End statement after the RegisterDLL custom action.
The new actions should appear after InstallFinalize in the Execute Immediate tab as shown below:
If NOT Installed then
Execute Program From Installation (UnregisterDLL)
Execute Program From Installation (RegisterDLL)
End
Legacy ID
3168
Article URL http://www.symantec.com/docs/HOWTO6328
Terms of use for this information are found in Legal Notices









Thank you.