I've made a custom action dll, which works fine. The custom action dll is put in the [APPDIR] and the custom action is defined in InstallExecuteSequence-->Uninstall with the expression (NOT Installed). This works very well. But sometimes one of my customers says they get an error saying the the installer cannot find the customactions.dll (.NET) which holds my custom actions. The uninstall then rollsback and the customer is therefore not able to uninstall.
So my idea was to add an extra check before invoking the custom action. I want the custom action only to run if the dll is physically present when the progam is uninstalled. So I added the expression 'AND (?SetupCustomActions.dll =3)'. I seems that if I test this by renaming/removing the actual dll the custom action is still executed, which results in the error. I assume that the component state is not affected if the actual file is removed. Am I right?
My next idea was to add a file search and check the state of the search in the expression of the custom action. So I added a File Search called 'CAPRESENT' (Name: SetupCustomActions.dll, Folder: [APPDIR], Depth: 1). I also added the standard action 'AppSearch' under InstallUISequence (I read somwhere on the forum that without it the file search is not executed.) Then I tried the expressions AND (CAPRESENT) and also AND (CAPRESENT <> ""). Both do not work the expression evaluates as 'false' for both.
What am I forgetting or doing wrong?
I was also wondering if I could embed custom action dll files in the installer so they can be used during the (un)installation, but are not put in the app folder?
Since the SetupCustomActions.dll is only used during the (un)install. That way I also want to make sure that the dll is always present because it will be unpacked every time the (un)install is initiated. Now I put the dll in the appdir when installing and are relying on the file to be still present when uninstalling. Is there some way to do that?
Thanks in advance!