Can't pass [APPDIR] to .NET Installer Class Action - Advanced Installer Community
CraigA
Posts: 1
Joined: Mon Jan 20, 2014 8:02 pm

Can't pass [APPDIR] to .NET Installer Class Action

I'm using a .NET Installer Class Action in order add some custom windows firewall rules. It works fine until I try to pass in the application install folder using the [APPDIR] property. When I provide [APPDIR] in the Installer Class Parameters dialog, I get a System.IO.FileNotFoundException. I can can pass in any other literal string like : "c:\foo\bar" and the installer proceeds without error.

Here is the error dialog:
installer_error_1001.PNG
installer_error_1001.PNG (10.87 KiB) Viewed 1551 times
Here is the custom action configuration:
custom_action.PNG
custom_action.PNG (64.25 KiB) Viewed 1551 times

What is causing this error? I believe this is the documented way to send install properties to the .NET custom install class.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Can't pass [APPDIR] to .NET Installer Class Action

Hello and welcome to Advanced Installer forums,

I think the problem is that the trailing "\" character from the value of APPDIR ("c:\foo\bar\") causes the next quote character to be escaped. To prevent this, include a space character after [APPDIR] in the Installer Class Parameters. So, when define your Installer Class Parameter – AppDir just add an space character after its value: [APPDIR] .

Another issue, although not related to the problem you are encountering, is the place where you have scheduled your Custom Action. You should add it under "Install" as "Deferred with no impersonation", because it performs system changes and it will fail if executed as Immediate.

By the way, have you noticed our predefined support for creating Firewall exceptions from the Windows Firewall page? Here, you can add applications or ports that you want to authorize / register in Windows Firewall.

Please let us know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”