Wrong APPDIR value in different builds - Advanced Installer Community
AzubiRA
Posts: 10
Joined: Tue Oct 14, 2014 9:59 am

Wrong APPDIR value in different builds

_Licence: ENTERPRISE
_Version: 10.6

Hi,

I made a Web-installer in which the
{ Install Parameters -> Installation Folders -> Application } value is set to a property K32PATH and the
{ ... -> ... -> Application Shortcut } value is set to
[DesktopFolder].

During installation, the FolderEdit field of FolderDlg correctly shows the value of K32PATH, which is extracted from a file search operation via
{ Custom Action -> ExecuteScriptCode -> someVBscript }
at PrepareDlg.

someVBscript looks like this:

Code: Select all

Dim location 
location = Session.Property("K32LOCATION")
Dim position
position = InStrRev( location, "\")
Session.Property("K32PATH") = Left( location, position-1)
Everything works fine. But:

Now I added another build of type
MSIbuild
(Options:
MSI with resources next to it
Place files unpacked in folders next to the MSI database)

and another of type
CDDVDbuild
(Options:
EXE setup with resources next to it
Archive installation files into CAB files + Compress + One CAB archive per feature)

In both these builds FolderEdit now contains some wrong path
{ C:\Program Files(x86)\myCompanyName\myApplicationName }

Now, with 'Run and log' I can see that the K32PATH is correctly set in ALL examples but APPDIR is set right one time but wrong the other times. Also SET_SHORTCUTDIR is set right the first time ( [DesktopFolder] ) but wrong the other times ( C:\ProgramData\Microsoft\Windows\Start Menu\Programs\myApplication ).
But I didn't change
{ Install Parameters -> Installation Folders -> Application }
or
{ Install Parameters -> Installation Folders. -> Application Shortcut }

Why is this happening??
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Wrong APPDIR value in different builds

Hello and welcome to Advanced Installer forums,

In the Application Folder field from the Install Parameters page you can specify the default path for the installation folder. This path is stored in the APPDIR property.

If you want to set the APPDIR property with the value of K32PATH property then you can use our predefined Set Installer custom action, something like:
SetAPPDIR.png
SetAPPDIR.png (2.43 KiB) Viewed 3272 times
Also, you can set the APPDIR inside your .vbs custom action using this statement:

Code: Select all

Session.Property("APPDIR") = Session.Property("K32PATH")
Make sure that the custom action that updates the APPDIR property is set after the Searches group from the Wizard Dialogs Stage. Also, you should condition the custom action that will update the value of the APPDIR property because if the related K32PATH property is not set (it does not contain any value), the APPDIR might be set with an empty string; so you will get an error during installation.

I've tested this scenario and the value of the APPDIR property was properly updated in each build.

Let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AzubiRA
Posts: 10
Joined: Tue Oct 14, 2014 9:59 am

Re: Wrong APPDIR value in different builds

I set the APPDIR property in my VBScript and it worked well.
Still wondering though why it would work with the Webinstaller but not with the CD version.

Thanks for your quick reply!
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Wrong APPDIR value in different builds

Hi,

As I can see, there are some builds where the APPDIR property is not set as expected.
Can you please give us a detailed test case scenario so we can investigate this?

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

Return to “Common Problems”