Thanks. But the project_afterInstall and other built-in handlers during uninstallation has less permissions (somehow) when during installation. That's why we used elevated managed action.
In our custom uninstall action ( UnInstallCertificatesAndStopTaskAction ) we delete certificates first (while all files are still exisisting in installDir ).
But another problem appears while we select and press Repair button on setup.msi :
the same custom action (UnInstallCertificatesAndStopTaskAction) is called again (like in unstallation process). And how to check that it's a Repearing and Uninstall state now while I'm inside custom action?
session.IsRepeare() throws exception, that it doesn't contain such key. In your project_AfterInstall you can get it from SetupEventArgs e but not in my custom elevated action. Answer from stackoverflow like session.EvalulateCondition("Installed"); throws the same error. Really I have only 2 properties in sesssion: INTSALLDIR = "C:\Program Files..." and UI = 3.
My action looks like this:
How to figure out which state is now running: uninstall or repeair inside custom action ?
In our custom uninstall action ( UnInstallCertificatesAndStopTaskAction ) we delete certificates first (while all files are still exisisting in installDir ).
But another problem appears while we select and press Repair button on setup.msi :
the same custom action (UnInstallCertificatesAndStopTaskAction) is called again (like in unstallation process). And how to check that it's a Repearing and Uninstall state now while I'm inside custom action?
session.IsRepeare() throws exception, that it doesn't contain such key. In your project_AfterInstall you can get it from SetupEventArgs e but not in my custom elevated action. Answer from stackoverflow like session.EvalulateCondition("Installed"); throws the same error. Really I have only 2 properties in sesssion: INTSALLDIR = "C:\Program Files..." and UI = 3.
My action looks like this:
new ElevatedManagedAction("UnInstallCertificatesAndStopTaskAction", Return.check, When.Before, Step.RemoveFiles, // we need files in install dir to remove certificates and stop tasks in scheduler first Condition.Installed )