Archive: Initializing variable and using


Initializing variable and using
I want to initialize variable and use it in my script.
I do the following

Var /GLOBAL SourcePath

Function .onInit
StrCpy $SourcePath "C:\1"
FunctionEnd

!insertmacro MUI_PAGE_LICENSE $SourcePath\license.rtf

I get next error
!insertmacro: MUI_PAGE_LICENSE
LicenseData: open failed "$SourcePath\license.rtf"

While ny code is comiled ok with
!insertmacro MUI_PAGE_LICENSE c:\1\license.rtf

Have I done something wrong?

Thanks,
Roman


This is a common misunderstood :)
Variables take action at runtime you can't use 'em in compile time since they're empty.

Use a definition instead.


I'm sorry for newbie question...but how should I do it?

Using macro?


!define SourcePath "C:\1"
... ${SourcePath}

Stu