srisdal
Posts: 6
Joined: Tue Apr 22, 2008 1:41 am

[APPDIR] with .Net Installer

I am using a .Net Installer Class Custom Action for my application, and need to pass the installation directory as a parameter. No matter what I try, if I make any reference to APPDIR my installer crashes. I have tried:

- Creating my own Install Parameter called INSTALL_DIRECTORY and setting it equal to APPDIR in a Published Event for the Next button of the FolderDlg. The Action Data for this looks like:

/LogFile="[PersonalFolder]install_log.txt" /ReqVersion=2.0.50727 /InstallType=notransaction /Action=Install /RevADetected="[REV_A_DETECTED]" /RevBDetected="[REV_B_DETECTED]" /InstallDirectory="[INSTALL_DIRECTORY]" /HistoryPath="[HISTORY_PATH]" "[#StyleLinkInstaller.dll]" "[TempFolder]dotNetCustAct.dll_Config.xml"

- I have tried simply passing APPDIR as the parameter to my program, crashes too. The action data for this looks like:

/LogFile="[PersonalFolder]install_log.txt" /ReqVersion=2.0.50727 /InstallType=notransaction /Action=Install /RevADetected="[REV_A_DETECTED]" /RevBDetected="[REV_B_DETECTED]" /InstallDirectory="[APPDIR]" /HistoryPath="[HISTORY_PATH]" "[#StyleLinkInstaller.dll]" "[TempFolder]dotNetCustAct.dll_Config.xml"

If I Run with Log, I can see the parameters being passed correctly to the .Net Installer, yet an error (2869) is thrown anytime APPDIR was used as noted above.

However, if I do not try to assign any new value to INSTALL_DIRECTORY parameter and use the default install path, and pass that as a parameter to my .Net Installer class everything works fine. Meaning that there does not seem to be any problems passing parameters to my installer.

Thoughts on why this is occurring and why APPDIR may be causing the problem? Thoughts on how to work around it?

Thanks,

Scott
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [APPDIR] with .Net Installer

Hi,

There is a similar discussion on the forum. Let me know if this doesn't solve your problem.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
srisdal
Posts: 6
Joined: Tue Apr 22, 2008 1:41 am

Re: [APPDIR] with .Net Installer

I tried both cases, adding a space after [APPDIR] in the event as well as adding it after [APPDIR] in Edit Installer Class Parameter dialog. I still receive the error. To make sure I understand, I am adding it after the right bracket, e.g. "[APPDIR] " Is this the correct fix?

Thanks,

Scott
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: [APPDIR] with .Net Installer

Hi,

Please note that you need to do this for all the properties in the "Action Data" field which are ended with a "\"character. This is because the trailing backslash character will make the next quote character to be escaped.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
srisdal
Posts: 6
Joined: Tue Apr 22, 2008 1:41 am

Re: [APPDIR] with .Net Installer

I understand. I had one other pathname on the line, adding a space to that one resolved the problem.

Thanks,

Scott

Return to “Common Problems”