Just to mention, the first 3 items go to my $INSTDIR, i.e. C:\Program Files\My codec pack\. So this goes here, a for the graphs items I need to choose the location.
How to do this?

17 posts

How to avoid this addon?Section "BlazeVideo/Moonlight/Overlay" SEC55
SetOutPath "$INSTDIR"
File "Graphs\ProgDVB\tv.blazevideo.xgr"
SectionEnd
So, I assume I need to change that $INSTDIR into absolute address like C:\Program Files\Nabukodonosor's DVB Pack? Is that right? Is there any other way?Section "Blaze Video Decoder 4.5.0.2" SEC02
SetOutPath "$INSTDIR\Video\Blaze Video Decoder 4.5.0.2"
File "Video\Blaze Video Decoder 4.5.0.2\Blaze VideoDecoder.ax"
SectionEnd

## Create $PLUGINSDIR
Function .onInit2
InitPluginsDir
FunctionEnd
Function IsPROG1Selected
Push $R0
Push $R1
StrCpy $R0 ${PROG1_StartIndex} # Group 1 start
Loop:
IntOp $R0 $R0 + 1
SectionGetFlags $R0 $R1 # Get section flags
IntOp $R1 $R1 & ${SF_SELECTED}
StrCmp $R1 ${SF_SELECTED} 0 +3 # If section is selected, done
StrCpy $R0 1
Goto Done
StrCmp $R0 ${PROG1_EndIndex} 0 Loop
Done:
Pop $R1
Exch $R0
FunctionEnd
Function IsPROG2Selected
Push $R0
Push $R1
StrCpy $R0 ${PROG2_StartIndex} # Group 2 start
Loop:
IntOp $R0 $R0 + 1
SectionGetFlags $R0 $R1 # Get section flags
IntOp $R1 $R1 & ${SF_SELECTED}
StrCmp $R1 ${SF_SELECTED} 0 +3 # If section is selected, done
StrCpy $R0 1
Goto Done
StrCmp $R0 ${PROG2_EndIndex} 0 Loop
Done:
Pop $R1
Exch $R0
FunctionEnd
Function IsPROG3Selected
Push $R0
Push $R1
StrCpy $R0 ${PROG3_StartIndex} # Group 3 start
Loop:
IntOp $R0 $R0 + 1
SectionGetFlags $R0 $R1 # Get section flags
IntOp $R1 $R1 & ${SF_SELECTED}
StrCmp $R1 ${SF_SELECTED} 0 +3 # If section is selected, done
StrCpy $R0 1
Goto Done
StrCmp $R0 ${PROG3_EndIndex} 0 Loop
Done:
Pop $R1
Exch $R0
FunctionEnd
## Here we are selecting first sections to install
## by unselecting all the others!
Function SelectFilesA
# We need to save the state of the Group 2 Sections
# for the next InstFiles page
Push $R0
Push $R1
StrCpy $R0 ${PROG2_StartIndex} # Group 2 start
Loop:
IntOp $R0 $R0 + 1
SectionGetFlags $R0 $R1 # Get section flags
WriteINIStr "$PLUGINSDIR\sections.ini" Sections $R0 $R1 # Save state
!insertmacro UnselectSection $R0 # Then unselect it
StrCmp $R0 ${PROG2_EndIndex} 0 Loop
# Don't install prog 1?
Call IsPROG1Selected
Pop $R0
StrCmp $R0 1 +4
Pop $R1
Pop $R0
Abort
# Set current $INSTDIR to PROG1_InstDir define
StrCpy $INSTDIR "${PROG1_InstDir}"
Pop $R1
Pop $R0
FunctionEnd
## Here we need to unselect all Group 1 sections
## and then re-select those in Group 2 (that the user had selected on
## Components page)
Function SelectFilesB
Push $R0
Push $R1
StrCpy $R0 ${PROG1_StartIndex} # Group 1 start
Loop:
IntOp $R0 $R0 + 1
!insertmacro UnselectSection $R0 # Unselect it
StrCmp $R0 ${PROG1_EndIndex} 0 Loop
Call ResetFiles
# Don't install prog 2?
Call IsPROG2Selected
Pop $R0
StrCmp $R0 1 +4
Pop $R1
Pop $R0
Abort
# Set current $INSTDIR to PROG2_InstDir define
StrCpy $INSTDIR "${PROG2_InstDir}"
Pop $R1
Pop $R0
FunctionEnd
## This will set all sections to how they were on the components page
## originally
Function ResetFiles
Push $R0
Push $R1
StrCpy $R0 ${PROG2_StartIndex} # Group 2 start
Loop:
IntOp $R0 $R0 + 1
ReadINIStr "$R1" "$PLUGINSDIR\sections.ini" Sections $R0 # Get sec flags
SectionSetFlags $R0 $R1 # Re-set flags for this sec
StrCmp $R0 ${PROG2_EndIndex} 0 Loop
Pop $R1
Pop $R0
FunctionEnd
Function SelectFilesC
# We need to save the state of the Group 3 Sections
# for the next InstFiles page
Push $R0
Push $R1
StrCpy $R0 ${PROG2_StartIndex} # Group 3 start
Loop:
IntOp $R0 $R0 + 1
SectionGetFlags $R0 $R1 # Get section flags
WriteINIStr "$PLUGINSDIR\sections.ini" Sections $R0 $R1 # Save state
!insertmacro UnselectSection $R0 # Then unselect it
StrCmp $R0 ${PROG2_EndIndex} 0 Loop
# Don't install prog 3?
Call IsPROG3Selected
Pop $R0
StrCmp $R0 1 +4
Pop $R1
Pop $R0
Abort
# Set current $INSTDIR to PROG1_InstDir define
StrCpy $INSTDIR "${PROG3_InstDir}"
Pop $R1
Pop $R0
FunctionEnd
StrCpy $R0 ${PROG1_StartIndex} # Group 1 start
Loop:
IntOp $R0 $R0 + 1
!insertmacro UnselectSection $R0 # Unselect it
StrCmp $R0 ${PROG1_EndIndex} 0 Loop