PDA

View Full Version : Set version at runtime



NewsArchive
05-09-2011, 03:30 AM
Hi All,

The docs clearly state that the Product Version in the Product
Properties visualizer is a compiler variable and may *NOT* be a runtime
variable.

In the script I am building I do not know the product version at compile
time. I need to read the version from an INI file and set it at runtime
so that I can update the WebUpdate data correctly ( HKEY_LOCAL_MACHINE >
SOFTWARE > Lindersoft > WebUpdates > Apps > GUID > LOCAL_VERSION ). All
the other entries are being entered just fine.

I have tried to make a registry entry very late in the install script
using a runtime variable but the %VariableName% is being entered as
"%VariableName%" and not "X.X.X.X"

Any ideas on how to accomplish this will be greatly appreciated.

--
*Regards*,

Lee
www.cya2day.com
CYA - Don't Leave Home Without One

NewsArchive
05-09-2011, 03:31 AM
Lee,

Quick note: a runtime variable %VariableName% should be named %VARIABLENAME%
(case-sensitive).

Friedrich

NewsArchive
05-10-2011, 12:50 AM
Hi Friedrich,

The variable in the script is all upper case. I used mixed case in the
Email simply for readability.

*Regards*,

Lee
www.cya2day.com
CYA - Don't Leave Home Without One

NewsArchive
05-10-2011, 12:51 AM
Hi Lee,

> The variable in the script is all upper case. I used mixed case in the
> Email simply for readability.

Aha, okay. But if it displays "%VARIABLENAME%" and not "X.X.X.X" then you
are using a variable that is not correctly initialized (value not set).


For example:

Set Variable %__NEVERTRUE__% to "1"
If %__NEVERTRUE__% Equals "0" Then
Set Variable %TEST% to "1.2.3.4"
End
Display Message Box "%TEST%" -- ""

The %TEST% variable value is never set, so it will display %TEST% here. If
you initialize it before the If Statement then it would be empty (and not
%TEST%).


For example:

Set Variable %TEST% to ""
Set Variable %__NEVERTRUE__% to "1"
If %__NEVERTRUE__% Equals "0" Then
Set Variable %TEST% to "1.2.3.4"
End
Display Message Box "%TEST%" -- ""


BTW, you should be able to use the "Update Client Version Number..." script
function to programmatically change an iDeploy Version Number.

Friedrich

NewsArchive
05-10-2011, 12:51 AM
Hi Friedrich,

See my responses below:

*Regards*,

Lee
www.cya2day.com
CYA - Don't Leave Home Without One

On 05/09/11 11:27 AM, Friedrich Linder wrote:
> Hi Lee,
>
>> The variable in the script is all upper case. I used mixed case in the
>> Email simply for readability.
>
> Aha, okay. But if it displays "%VARIABLENAME%" and not "X.X.X.X" then you
> are using a variable that is not correctly initialized (value not set).

The variable is initialized to "" at the very beginning of the script.
This makes the variable always available to me using the Ctrl > Right
mouse click. I'm basically lazy and enjoy using these shortcuts....<g>

>
>
> For example:
>
> Set Variable %__NEVERTRUE__% to "1"
> If %__NEVERTRUE__% Equals "0" Then
> Set Variable %TEST% to "1.2.3.4"
> End
> Display Message Box "%TEST%" -- ""
>
> The %TEST% variable value is never set, so it will display %TEST% here. If
> you initialize it before the If Statement then it would be empty (and not
> %TEST%).

The variable, in my case %RESTORE_VERSION% is populated by reading a
value from an INI file. I am quite certain I tested to make certain the
variable was populated correctly. The value in %RESTORE_VERSION% matched
the corresponding value in the INI file. This is why I was so puzzled
when "%RESTORE_VERSION%" was written to LOCAL_VERSION in the registry
and not the contents.

>
>
> For example:
>
> Set Variable %TEST% to ""
> Set Variable %__NEVERTRUE__% to "1"
> If %__NEVERTRUE__% Equals "0" Then
> Set Variable %TEST% to "1.2.3.4"
> End
> Display Message Box "%TEST%" -- ""
>
>
> BTW, you should be able to use the "Update Client Version Number..." script
> function to programmatically change an iDeploy Version Number.

I am ashamed to say that I never saw this function. Let me play with
this and see what happens.

Thanks ever so much for your reply.

>
> Friedrich
>
>
>

NewsArchive
05-10-2011, 12:52 AM
Hi Lee,

> The variable is initialized to "" at the very beginning of the script.
> This makes the variable always available to me using the Ctrl > Right
> mouse click. I'm basically lazy and enjoy using these shortcuts....<g>

If you use "Display Message Box" to display the value of %RESTORE_VERSION%
one line BEFORE you write it to the registry, what do you see?

Thanks,
Friedrich

NewsArchive
05-11-2011, 01:43 AM
Hi Friedrich,

As usual it was *driver error*.

After I did my testing using a message box to verify the contents of
%RESTORE_VERSION% was getting populated correctly from the INI file, I
moved the line of code that SET that variable into an IF statement.

It was the IF statement that was causing the problem.

I have it sorted out now.

*Regards*,

Lee
www.cya2day.com
CYA - Don't Leave Home Without One

NewsArchive
05-11-2011, 01:44 AM
Hi Lee,

>
> I have it sorted out now.
>

Perfect! Thanks for the update.

Friedrich