PDA

View Full Version : Using global var for a path



NewsArchive
07-18-2012, 03:08 AM
hello all,

I am trying to use a global var to store the version used of codejock
activex

I would need to be able to "generalize" these lines (the ones where I
define the physical files to use)

Install File "C:\Program Files (x86)\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX
v15.2.1\Bin\Codejock.CommandBars.v15.2.1.ocx" to
"%IS_CJINSTALL_PATH%\Codejock.CommandBars.v15.2.1.o cx" (Always
Install)

Queue existing OCXs/DLLs/EXEs/TLBs file for self-registration
"%IS_CJINSTALL_PATH%\%IS_INSTALL_CJ_COMMANDBAR_OCX%"

All is "built" like this (in the top portion of the script) :

__________________________________________________ ____________________
!
////////////////////////////////////////////////////////////////////////////////
! CodeJock Installs
Set Variable %IS_64X_OS% to FUNCTION:Get System Info(WOW64 Status)
Set Variable %IS_INSTALL_CJ_VERSION% to "15.2.1"
Set Variable %IS_INSTALL_CJ_FULL_NAME% to "Software\Codejock
Software\Xtreme SuitePro ActiveX v"
Set Variable %IS_INSTALL_CJ_FULL_NAME% to "%IS_INSTALL_CJ_VERSION%"
[Append Value]
Set Variable %IS_CJINSTALL_PATH% to FUNCTION:Get Registry Key
Value("Default") from "HKEY_CURRENT_USER\%IS_INSTALL_CJ_FULL_NAME%"
Set Variable %IS_INSTALL_COMMANDBAR% to "0"
Set Variable %IS_INSTALL_DOCKINGPANE% to "0"
Set Variable %IS_INSTALL_REPORTCONTROL% to "0"
Set Variable %IS_INSTALL_FLOWGRAPH% to "0"
Set Variable %IS_INSTALL_PROPERTYGRID% to "0"
Set Variable %IS_INSTALL_CJ_COMMANDBAR_NAME% to
"Codejock.CommandBars.v"
Set Variable %IS_INSTALL_CJ_COMMANDBAR_NAME% to
"%IS_INSTALL_CJ_VERSION%" [Append Value]
Set Variable %IS_INSTALL_CJ_COMMANDBAR_OCX% to
"%IS_INSTALL_CJ_COMMANDBAR_NAME%.ocx"
Set Variable %IS_INSTALL_CJ_DOCKINGPANE_NAME% to
"Codejock.DockingPane.v"
Set Variable %IS_INSTALL_CJ_DOCKINGPANE_NAME% to
"%IS_INSTALL_CJ_VERSION%" [Append Value]
Set Variable %IS_INSTALL_CJ_DOCKINGPANE_OCX% to
"%IS_INSTALL_CJ_DOCKINGPANE_NAME%.ocx"
Set Variable %IS_INSTALL_CJ_REPORTCONTROL_NAME% to
"Codejock.ReportControl.v"
Set Variable %IS_INSTALL_CJ_REPORTCONTROL_NAME% to
"%IS_INSTALL_CJ_VERSION%" [Append Value]
Set Variable %IS_INSTALL_CJ_REPORTCONTROL_OCX% to
"%IS_INSTALL_CJ_REPORTCONTROL_NAME%.ocx"
Set Variable %IS_INSTALL_CJ_FLOWGRAPH_NAME% to "Codejock.FlowGraph.v"
Set Variable %IS_INSTALL_CJ_FLOWGRAPH_NAME% to
"%IS_INSTALL_CJ_VERSION%" [Append Value]
Set Variable %IS_INSTALL_CJ_FLOWGRAPH_OCX% to
"%IS_INSTALL_CJ_FLOWGRAPH_NAME%.ocx"
Set Variable %IS_INSTALL_CJ_PROPERTYGRID_NAME% to
"Codejock.PropertyGrid.v"
Set Variable %IS_INSTALL_CJ_PROPERTYGRID_NAME% to
"%IS_INSTALL_CJ_VERSION%" [Append Value]
Set Variable %IS_INSTALL_CJ_PROPERTYGRID_OCX% to
"%IS_INSTALL_CJ_PROPERTYGRID_NAME%.ocx"
If %IS_CJINSTALL_PATH% Does Not Equal "" Then
Set Variable %IS_CJINSTALL_PATH% to "\Bin" [Append Value]

Set Variable %IS_INSTALL_COMMANDBAR_CLSID% to FUNCTION:Get Registry
Key Value("CLSID") from
"HKEY_CLASSES_ROOT\%IS_INSTALL_CJ_COMMANDBAR_NAME%"
If %IS_INSTALL_COMMANDBAR_CLSID% Does Not Equal "" Then
Set Variable %IS_INSTALL_COMMANDBAR% to "1"
End
Set Variable %IS_INSTALL_DOCKINGPANE_CLSID% to FUNCTION:Get Registry
Key Value("CLSID") from
"HKEY_CLASSES_ROOT\%IS_INSTALL_CJ_DOCKINGPANE_NAME%"
If %IS_INSTALL_DOCKINGPANE_CLSID% Does Not Equal "" Then
Set Variable %IS_INSTALL_DOCKINGPANE% to "1"
End
Set Variable %IS_INSTALL_REPORTCONTROL_CLSID% to FUNCTION:Get
Registry Key Value("CLSID") from
"HKEY_CLASSES_ROOT\%IS_INSTALL_CJ_REPORTCONTROL_NAM E%"
If %IS_INSTALL_REPORTCONTROL_CLSID% Does Not Equal "" Then
Set Variable %IS_INSTALL_REPORTCONTROL% to "1"
End
Set Variable %IS_INSTALL_FLOWGRAPH_CLSID% to FUNCTION:Get Registry
Key Value("CLSID") from
"HKEY_CLASSES_ROOT\%IS_INSTALL_CJ_FLOWGRAPH_NAME%"
If %IS_INSTALL_FLOWGRAPH_CLSID% Does Not Equal "" Then
Set Variable %IS_INSTALL_FLOWGRAPH% to "1"
End
Set Variable %IS_INSTALL_PROPERTYGRID_CLSID% to FUNCTION:Get
Registry Key Value("CLSID") from
"HKEY_CLASSES_ROOT\%IS_INSTALL_CJ_PROPERTYGRID_NAME %"
If %IS_INSTALL_PROPERTYGRID_CLSID% Does Not Equal "" Then
Set Variable %IS_INSTALL_PROPERTYGRID% to "1"
End
Else
If %IS_64X_OS% Equals "1" Then
Set Variable %IS_CJINSTALL_PATH% to "C:\Program Files
(x86)\Codejock Software\ActiveX\Xtreme SuitePro ActiveX
v%IS_INSTALL_CJ_VERSION%\Bin"
Else
Set Variable %IS_CJINSTALL_PATH% to "C:\Program Files\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX v%IS_INSTALL_CJ_VERSION%\Bin"
End
End
!
////////////////////////////////////////////////////////////////////////////////
__________________________________________________ ____________________

Is there a "SB" way of doing this - thus avoiding me to change all BUT
the %IS_INSTALL_CJ_VERSION% value ?

Merci

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-06-2012, 04:12 AM
ping .... anyone home with an idea here please ? B-)

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-06-2012, 04:13 AM
Hi,

I'm not sure, if I understand you correctly, but you can do the following:

#set compiler [MYUNIVERSAL] variable to IS_CJINSTALL_PATH

or what ever you want and use this later in your script:

set variable %[MYUNIVERSAL]% to ...

or

if %[MYUNIVERSAL]% equal ...

ans so on.

Markus

NewsArchive
08-06-2012, 04:14 AM
Hello,

I am trying to see if this can be generalized so as not to have to
manualy change the hd file each time a version is changed

Install File "C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme
SuitePro ActiveX v15.2.1\Bin\Codejock.CommandBars.v15.2.1.ocx" to
"%IS_CJINSTALL_PATH%\Codejock.CommandBars.v15.2.1.o cx"

to

Install File "C:\Program Files (x86)\Codejock Software\ActiveX\Xtreme
SuitePro ActiveX v15.3.1\Bin\Codejock.CommandBars.v15.3.1.ocx" to
"%IS_CJINSTALL_PATH%\Codejock.CommandBars.v15.3.1.o cx"

The pb is not the "output" path which works fine but the "source" path
and file name which changes each new version of CJ

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-06-2012, 04:16 AM
Hi,

I would do this like shown in the attached screenshot.

Markus

NewsArchive
08-06-2012, 06:25 AM
I tried this but when I compiled I received an error 'file not found'

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-06-2012, 06:25 AM
Argh I Mean [MYVERSION] instead of %MYVERSION%

You have to set a compiler var.

Markus.

NewsArchive
08-06-2012, 06:26 AM
Oh

Thanks let me test this

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-06-2012, 06:26 AM
JP,

Here is an "old" configurable Xtreme SuitePro ActiveX v12 include script.
Perhaps you can use this method.

http://www.lindersoft.com/projects/xtremesuiteproactivexv12.zip

http://www.lindersoft.com/forums/showthread.php?t=9633

Friedrich

NewsArchive
08-06-2012, 07:26 AM
Too late my friend ;)
Markus beat you to it with the "compiler var" trick

Thanks all the same for the scripts posted.

BTW if anyone else needs this entire SB script (based on versions and
two small vars... actualy one var and one compiler var) to install CJ
with SECURITY lol ie not to overwirte always so that when you un
install an app it does NOT break other apps settings I posted it in CJ
skype chat and can paste it here also

#set compiler variable [CJ_VERSION_VAR] = "v15.3.1"

and then

! Install and Register all OCX's
!
////////////////////////////////////////////////////////////////////////////////
If %IS_INSTALL_COMMANDBAR% Equals "0" Then
Install File "C:\Program Files (x86)\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX
[CJ_VERSION_VAR]\Bin\Codejock.CommandBars.[CJ_VERSION_VAR].ocx" to
"%IS_CJINSTALL_PATH%\Codejock.CommandBars.[CJ_VERSION_VAR].ocx"
(Always Install)
Queue existing OCXs/DLLs/EXEs/TLBs file for self-registration
"%IS_CJINSTALL_PATH%\%IS_INSTALL_CJ_COMMANDBAR_OCX%"
End
If %IS_INSTALL_DOCKINGPANE% Equals "0" Then
Install File "C:\Program Files (x86)\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX
[CJ_VERSION_VAR]\Bin\Codejock.DockingPane.[CJ_VERSION_VAR].ocx" to
"%IS_CJINSTALL_PATH%\Codejock.DockingPane.[CJ_VERSION_VAR].ocx"
(Always Install)
Queue existing OCXs/DLLs/EXEs/TLBs file for self-registration
"%IS_CJINSTALL_PATH%\%IS_INSTALL_CJ_DOCKINGPANE_OCX %"
End
If %IS_INSTALL_FLOWGRAPH% Equals "0" Then
Install File "C:\Program Files (x86)\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX
[CJ_VERSION_VAR]\Bin\Codejock.FlowGraph.[CJ_VERSION_VAR].ocx" to
"%IS_CJINSTALL_PATH%\Codejock.FlowGraph.[CJ_VERSION_VAR].ocx" (Always
Install)
Queue existing OCXs/DLLs/EXEs/TLBs file for self-registration
"%IS_CJINSTALL_PATH%\%IS_INSTALL_CJ_FLOWGRAPH_OCX%"
End
If %IS_INSTALL_PROPERTYGRID% Equals "0" Then
Install File "C:\Program Files (x86)\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX
[CJ_VERSION_VAR]\Bin\Codejock.PropertyGrid.[CJ_VERSION_VAR].ocx" to
"%IS_CJINSTALL_PATH%\Codejock.PropertyGrid.[CJ_VERSION_VAR].ocx"
(Always Install)
Queue existing OCXs/DLLs/EXEs/TLBs file for self-registration
"%IS_CJINSTALL_PATH%\%IS_INSTALL_CJ_PROPERTYGRID_OC X%"
End
If %IS_INSTALL_REPORTCONTROL% Equals "0" Then
Install File "C:\Program Files (x86)\Codejock
Software\ActiveX\Xtreme SuitePro ActiveX
[CJ_VERSION_VAR]\Bin\Codejock.ReportControl.[CJ_VERSION_VAR].ocx" to
"%IS_CJINSTALL_PATH%\Codejock.ReportControl.[CJ_VERSION_VAR].ocx"
(Always Install)
Queue existing OCXs/DLLs/EXEs/TLBs file for self-registration
"%IS_CJINSTALL_PATH%\%IS_INSTALL_CJ_REPORTCONTROL_O CX%"
End
!
////////////////////////////////////////////////////////////////////////////////


--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-06-2012, 07:26 AM
> Too late my friend ;)
> Markus beat you to it with the "compiler var" trick

<G> ;-)

Friedrich

NewsArchive
08-06-2012, 07:27 AM
Somehow, I don't see normal usage as a "trick" - esp when used against
"The Architect" <g>

--

Russ Eggen
RADFusion International, LLC

NewsArchive
08-06-2012, 07:39 AM
"Markus beat you to it with the "compiler var" trick"

architect ??????????????????????????????

anyway....

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-07-2012, 01:12 AM
Reference to The Architect in The Matrix

Michael Melby

NewsArchive
08-07-2012, 01:12 AM
I'll have to look that up then - sorry I must live in "another world"
:'(
Thanks for the explanation

--
JP
__________________________________________________ _____

For those who do not understand ... : "Qui bene amat bene castigat."
__________________________________________________ _____

DMC - Data Management Center : a tool to let you Migrate Import Export
Transfer your Data
www.dmc-fr.com

NewsArchive
08-07-2012, 01:13 AM
Not to worry JP - it was the last movie I watched <blush>

--

Russ Eggen
RADFusion International, LLC