Using special virtual text <%Env %>

This forum has been archived and is no longer active.

The new forum is located at:

https://sourceforge.net/apps/phpbb/installjammer/

You may continue to view and search the topics in this forum, but no new posts can be created.

Using special virtual text <%Env %>

Postby drjhgray » Tue Aug 23, 2011 3:14 pm

I am attempting to create an installer that can detect whether a user is on 32 bit architecture or 64 bit architecture and set Environment Variables appropriately. Starting on my 32 bit box, I have a Set Virtual Text action using Virtual Text name (ProcessorArch) and value <%Env PROCESSOR_ARCHITECTURE%>. When I build the installer on the 32 bit box the Virtual Text (ProcessorArch) appears to be set to x86 as expected. When I copy the installer to the 64 bit box and execute it there, it appears that the Virtual Text (ProcessorArch) does not get reset to AMD64 but stays at x86. Is the Set Virtual Text action not executed again on the 64 bit box when the installer is executed? If not, what is the best way to check the local PROCESSOR_ARCHITECTURE environment variable and set Virtual Text to test on?
drjhgray
 
Posts: 5
Joined: Tue Aug 23, 2011 2:57 pm

Re: Using special virtual text <%Env %>

Postby hsehdar » Wed Aug 24, 2011 7:20 am

Here in this forum this topic was conversed earlier. Taking queue from it here is one solution

1. Add action Execute Script with Result Virtual Text = WinArch and Tcl Script =
Code: Select all
if {$::env(PROCESSOR_ARCHITECTURE) ne "x86" || [info exists ::env(PROCESSOR_ARCHITEW6432)]} {
    ## 64-bit machine
    return 1
} else {
    ## 32-bit machine
    return 0
}

This will return if Windows architecture is 32 (false) or 64 bit (true).
2. Add action Execute Script with condition <%WinArch%> = true and Tcl Script =
Code: Select all
::InstallAPI::SetVirtualText -virtualtext PROGRAM_FILES -value $::env(ProgramW6432)
::InstallAPI::SetVirtualText -virtualtext InstallDir -value <%PROGRAM_FILES%>/<%Company%>/<%AppName%>


Hope this is helpful.
hsehdar
 
Posts: 134
Joined: Sun Sep 26, 2010 7:16 am

Re: Using special virtual text <%Env %>

Postby drjhgray » Wed Aug 24, 2011 1:52 pm

Thanks that did help.

One other followup question: can the results of script one (the one returning true of false) be applied to a pane with two radiobutton widgets

1 32 bit architecure

2 64 bit architecture

so that the results will select the correct option based on the architecture?

My thinking is it may take two If statements the one you have and another one equal to x86.
drjhgray
 
Posts: 5
Joined: Tue Aug 23, 2011 2:57 pm

Re: Using special virtual text <%Env %>

Postby drjhgray » Wed Aug 24, 2011 3:14 pm

I think I have figured out the answer to previous question but I have another question concerning the first script provided above.

I added an action Execute Script. Set the Virtual Script to WinArch and the tcl script to your provided script (the first one). When I execute my installer on a 32 bit machine it works fine, but when I copy the installer to the 64 bit machine and execute WinArch still comes out as false instead of true. From my standpoint the script is acting the same way that the <%Env PROCESSOR_ARCHITECTURE%> virtual text acted that generated the question in the first place. I must be doing something wrong still.
drjhgray
 
Posts: 5
Joined: Tue Aug 23, 2011 2:57 pm


Return to Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron