On Uninstall restore overwriten file?
I have a Software that has a license.dat.
by exchanging this license.dat with an other version i get an advanced functionality of the software.
I'm trying to make a msi that overwrites the existing license.dat on installation. (That's the easy part)
when the uninstall of the msi runs it should restore the old license.dat.
can i get this done with msi internal functions? If yes, how?
by exchanging this license.dat with an other version i get an advanced functionality of the software.
I'm trying to make a msi that overwrites the existing license.dat on installation. (That's the easy part)
when the uninstall of the msi runs it should restore the old license.dat.
can i get this done with msi internal functions? If yes, how?
0 Comments
[ + ] Show comments
Answers (3)
Please log in to answer
Posted by:
turbokitty
13 years ago
Posted by:
sv408
13 years ago
Well AcIvi,
You'll need to save the old license.dat somewhere else or with a different name during the install. I recommend doing that with a custom action that has a condition set to execute during install. It will need to be sequenced before the component containing the new license.dat file is installed.
You'll also need to restore the old license.dat back to its original location (or name) during the uninstall. I recommend doing that with a custom action that has a condition set to execute only during uninstall.
You'll need to save the old license.dat somewhere else or with a different name during the install. I recommend doing that with a custom action that has a condition set to execute during install. It will need to be sequenced before the component containing the new license.dat file is installed.
You'll also need to restore the old license.dat back to its original location (or name) during the uninstall. I recommend doing that with a custom action that has a condition set to execute only during uninstall.
Posted by:
India_Repackaging
13 years ago
Hi AcIvI,
You can add a custom action in the form of a VBScript which copies the file from a path to the License.dat location. I would have created a folder in the Sourcedir and copied the file from that folder during uninstall.
Hence your CA must be
I think this should work
You can add a custom action in the form of a VBScript which copies the file from a path to the License.dat location. I would have created a folder in the Sourcedir and copied the file from that folder during uninstall.
Hence your CA must be
- Call VBScript from Embedded Code / Installation
- REMOVE~="ALL" (during uninstallation)
- Schedule it just before InstallFinalize
- Deferred System Context
- Synchronous Ignore on Exit Code
- Copies from SourceDir\Old
License\License.dat to required location
- You will have to make use of CustomAction Data
I think this should work

so that the conversation will remain readable.