COMPILIER VARIABLES

Got a problem you cannot solve? Try here.
penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

COMPILIER VARIABLES

Postby penfold » Fri Jul 29, 2011 10:05 am

Hi,,

I am encountering a strange problem with compilier variables, I am using to variable to control what files are included in the build, is there a file that contains this variables or translated variables that can get corrupted, and if so how can I fix it. I have spent three days trying to fathom out what is going on with the tool, and can not see anything wrong programatically with the code. Unfortuantly I can not send the code, and I think a file has got corrupted because the one on the flags always seems to be seem as ON instead of OFF during a compile. I can see that it is incorrectly including files that are wrapped by a compilier variable when that flag is set OFF ?

Any Suggestions?

Regards
Steve

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: COMPILIER VARIABLES

Postby giaviv » Fri Jul 29, 2011 10:43 pm

Hi Steve,

Compiler variables are defined in the *.mpr file - you can open the file with a text editor and search for your compiler variables' names - do the values make sense?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Mon Aug 01, 2011 2:56 am

Hi,

Ok let me expalin further; the installation is spread across various script files for maintainability, and ease of readability.

here is an example of the script that is compiling in install files even though the script has an explicit compilier variable at the top of the script not to include any of the code in the script and hence files in the build;

i.e. BUILDWINXP is set to NO via the IDE project settings ? yet the compilier is still including the files in the build.

This will work on a clean project, however something is corrupt somewhere in the exisiting project. I do not wish to spend loads of time, creating a new project and copying / re-typing all the code again;

Comment: COMPONENTS FOR WINDOWS XP

[compiler if Variable BUILDWINXP Equals (Ignore Case) YES]
[compiler if Variable ISCOMMERCIAL not Equals TRUE]

[DEFINE REGION: COMPONENTS]
if Variable REMOVE Equals FALSE
Comment: First Thing we do... Get the system Bus Width 64 bit or 32 bit
Get System Setting Windows in 64 bit Mode into IS64BIT
if Variable IS64BIT Equals TRUE
Set x64 - Native 64 bit Windows, AMD64 and EM64T Architectures - installation mode
end
Get Folder Location System->System Directory into WINSYSDIR
Get Component Baseline Selection State into Variable ISBASELINE
if Variable ISBASELINE Equals TRUE
if Variable STANDARD_INSTALL Equals TRUE

[DEFINE REGION: STANDARD INSTALL]
if Variable IS64BIT Equals FALSE
[compiler if Variable BUILD_INC_WINXP Equals TRUE]
Install Files A to $TARGETDIR$, include subfolders
Install Files B to $WINSYSDIR$\Drivers
Install Files C to $TARGETDIR$
Install Files D to $TARGETDIR$
[compiler end]

if Variable IS_INJ_FILES Equals FALSE
Does File Exist X (get result into variable IS_CFG_PRESENT)
Install Files E to $TARGETDIR$
if Variable IS_CFG_PRESENT Equals FALSE
Install Files F to $WINSYSDIR$\Drivers
end
end
else
Comment: 64 Bit OS not supported at this time
MessageBox: $TITLE$ Setup Error, This product only supports 32 Bit Windows XP$NEWLINE$$NEWLINE$Setup cannot continue.
Terminate Installation
end
<<Code Folding Region>>
else
Comment: NONE STD INSTALLER

[DEFINE REGION: NONE STD INSTALL]
Comment: EXTRACT BASELINE COMPONENTS
if Variable IS64BIT Equals FALSE
Install Files G to $SFXPATH$ (Permanent)
Install Files H to $SFXPATH$ (Permanent)
else
Comment: 64 Bit OS not supported at this time
MessageBox: $TITLE$ Setup Error, This product only supports 32 Bit Windows XP$NEWLINE$$NEWLINE$Setup cannot continue.
Terminate Installation
end
<<Code Folding Region>>
end
end
end
<<Code Folding Region>>
[compiler end]
[compiler end]

Thanks
Steve

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: COMPILIER VARIABLES

Postby giaviv » Mon Aug 01, 2011 11:41 am

Hi Steve,

Looking at your code, I don't see anything out of the ordinary. However, it could very well be that for example you did not close an If.. block with an End for; or that you somehow messed up the flow of your installer. I would suggest debugging.

I am attaching a sample project that demonstrates that the use of compiler variables inside scripts definitely does work, I hope it will help.
Attachments
Inclusion.zip
(2.98 MiB) Downloaded 524 times
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Tue Aug 02, 2011 3:22 am

Hi,

I have gone a few steps and slowely reintroduced code as I went along, tendious!.. I would of thought that if the if , end statements were not aligned or missing the compilier would complain. The Compilkier variabel in question has been deliberatly place at the top of the script with a compilier end at the bottom of the script, so getting to the point where I am at a total loss as to what the problem is.

You say debug the code, how can I when its at the compilier stage, unless you can debug the compilier?

Regards
Steve

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Tue Aug 02, 2011 8:00 am

Hi,

Ok I have experimented with your sample and managed to make it fail in the sort of way that we are using InstallAware. If you remove the second compilier var it works as expected. Wierd?

Steve
Attachments
Inclusion_Fail.zip
(2.84 MiB) Downloaded 530 times

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Tue Aug 02, 2011 9:30 am

Hi ,

Further to the supplied sample, on the build popup window, when it say's copying files does that mean that it is being included in the installation, if there were two, i.e. duplicates. Will the copy just overwrite the exisiting one, such that only one file is kept in the installation file?

P.S. dont forge to check out the new source supplied which appears not to include any files in the sample, when imo it should include at least one, i.e. in the build popup windows, it should say copying files.

Regards
Steve

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: COMPILIER VARIABLES

Postby giaviv » Tue Aug 02, 2011 10:24 am

Hey Steve,

First, I mean debugging as in debugging the setup and making sure your Install File commands are called.

Secondly, the reason that your example is failing is simple - you are conditionally including scripts, the condition being at runtime - the exact OS level is NOT determined until you run your setup on the TARGET MACHINE (otherwise, whats the point of it)?

Compiler variables are evaluates at BUILD time. In your case, you include BOTH scripts because the If Variable SYSTEM_OS in Script1 does not get evaluates until the setup actually runs (in other words, post build). That is what's causing your issues.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Wed Aug 03, 2011 2:44 am

Hi,

I understand what you are saying , but I beleive your explanation is flawed, as the compilier variable idea would never work; consider this. ok so the inclusion on the include script happens at runtime. BUT the build should of evaluated the include script and removed the code in it, based on the compilier variables, does that not make logical sence, what am I missing here. What you seem to be saying under this condition the compiler variable in the script does not get evaluated until runtime? Surely the script, (script 2 /3) in its isolation gets evaluted at compile time, as they are called compilier variables?

How does the compilier evalute the include statement, is it expanded first then evaluated, in which case the compilier would just put NO code in the if statement for the OS check, what is wrong with that? that is what i wanted it todo, maybe it should just have a message box saying something like "Not Supported" but that is our implementation issues.

In our real installer the OS is checked as a dependancy and will never reach that part of the code, this mechanisum has the effect of removing unwanted code in the exe and reducing its size for Windows 7 only installer or Windows XP installer?

What you MISSED is the fact that when I introduced the second compilier variable in the script ISCOMMERCIAL, the build window did not report any copying of any files , if you remove this compilier variable the builds works following the two other compilier variable flags as expected, if you set ISWINXP, I get the build windows ONLY copying the test winxp file, if I set ISWIN7, I get the build window ONLY copying the win7 test file, If I set both flags I get both files included in the build shown by the build window , and hence a full XP / Win7 installer in one exe or a single one based on the OS is wishes to support.

So without the ISCOMMERCIAL flag in my sample the code works as expected and removes the files for the appropiate o/s this in itself negates the statement you have made in your previous post. The compiler variables are not evaluated at runtime?

Regards
Steve

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Thu Aug 04, 2011 1:55 am

Hi,

So what you are really saying in a round about way is that the product has a bug in it. After some 8 days of fiddling with the installer code, I have found in my case that one of the files was indeed corrupt, re-entering this code in a newley created script has sorted the problem I was having. However! this now has discovered that the installer is indeed flawed in this area.

1. So if it is a known problem when is it going to get fixed?

2. If it is fixed in the latest version, and will never be fixed in older releases, you may be getting a phone call from my OP about getting a free copy of the latest version to fix the bug?

Regards
Steve

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: COMPILIER VARIABLES

Postby giaviv » Fri Aug 05, 2011 11:21 am

Steve,

There is no bug with InstallAware. The reason your code isn't working is that your compiler if Variable command contains the value ISCOMMERIAL instead of ISCOMMERCIAL.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

penfold
Posts: 48
Joined: Mon Jan 17, 2011 8:37 am

Re: COMPILIER VARIABLES

Postby penfold » Mon Aug 08, 2011 2:23 am

Hi

Ok so I missed typed the sample, (in haste as I am under presure now to wrap this up) but that doesnt explain the corrupted file in the version I was trying to sort out. In the end all i did was create a new script and use the IDE to copy and past code from one script to another and then it all worked. So I am still convinced there are issues with installaware. What I am also seeing is that when you move a project on the same pc to another directory, the command line build fails to build with a missing internal file used by installaware, if I run up installaware on the project then exit, it asks me to save the scripts? as there has been no change to the project why is it asking me this? after performing this little tickle with the project I can then command line build the project. This will give other's issues when checking out the project from CVS and attempting a command line build.

You also state that there are issues with compilier variables which leads me to the conclusion that there are problems with installaware, your response does not clearly state what these issues are, if there are restrictions with the script langauge then you have not said this. The documentation is also a bit wooley in this area.

Regards
Steve

giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: COMPILIER VARIABLES

Postby giaviv » Mon Aug 08, 2011 10:09 am

Steve,

As I said, there are no bugs with IA or its use of Compiler Variables.
We are more than happy to look for issues and fix them, but your sample project did not present any problems with InstallAware.

When you move a project, you break all the links to the old directory. What I like to do is use a text editor and do a Replace in Files and replace every instance of the absolute path of the old directory to the absolute path of the new one.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 124 guests