anupmistry
Posts: 52
Joined: Tue Jan 12, 2010 6:39 pm

Set APPDIR

Need to set the APPDIR when user clicks NEXT on the Welcome screen. The APPDIR I want is %PROGRAM FILES%\myappname\ which will translate to ...
(On 32-bit)
C:\Program Files\myappname\
(On 64-bit)
C:\Program Files (x86)\myappname\

Thinking I can write a vbscript somehow that can change the Session.Property("APPDIR").

Can you tell me how to achieve this?

Thanks
marcoburi
Posts: 13
Joined: Wed Sep 21, 2011 8:37 pm

Re: Set APPDIR

It would look something likes this.

Function SetPath()

If (condition32) Then
Session.Property("APPDIR") = " C:\Program Files (x86)"
Else
Session.Property("APPDIR") = "C:\Program Files"

End If
End Function


The problem I see is that 32 bit application are stored in the C:\Program Files (x86) folder and 64 bit are stored in the C:\Program Files folder on 64bit systems

It's not the system that decides the folder but tha app itself.

Good luck
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Set APPDIR

Hello,

You can add a "Property set with Formatted" predefined custom actions on the "Next" button using this article:
  • it should have its "Formatted field" set to:

    Code: Select all

    [ProgramFilesFolder][ProductName]
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”