List-Archive: 
<http://www.mail-archive.com/mindtreeinsight-users@lists.sourceforge.net>
We need to modify a file by calling a function in the section as
follows. see AdvReplaceInFile
in the following section.
 
We also need to SetShellVarContext All.
 
Is this possible
 
 Section "Hauptgruppe" SEC01
  RMDir /r "$INSTDIR\lib"
  RMDir /r "$INSTDIR\etc"
  RMDir /r "$INSTDIR\images"
  RMDir /r "$INSTDIR\bin"
  SetOutPath "$INSTDIR"
  SetOverwrite on
  SetShellVarContext all
  CreateDirectory "$SMPROGRAMS\MammaCert Collect"
  CreateShortCut "$SMPROGRAMS\MammaCert Collect\MammaCert Collect.lnk"
"$INSTDIR\bin\mammacert-collect-app.bat" "" "$INSTDIR\bin\collect.ico"
  CreateShortCut "$DESKTOP\MammaCert Collect.lnk"
"$INSTDIR\bin\mammacert-collect-app.bat" "" "$INSTDIR\bin\collect.ico"
 
  File /r /x .svn "release\mammacert-collect-app\*.*"
  File /r /x .svn "..\binaries\dcmtk-win32-i386"
 
  CopyFiles $INSTDIR\etc\ApplicationConfig.xml.sample
$INSTDIR\etc\ApplicationConfig.xml
  
  ; Replace @DICOM_TOOLKIT@ with correct value in ApplicationConfig.xml
  Push @DICOM_TOOLKIT@                        #text to be replaced
  Push "$INSTDIR\dcmtk-win32-i386"            #replace with
  Push all                                    #replace all occurrences
  Push all                                    #replace all occurrences
  Push $INSTDIR\etc\ApplicationConfig.xml     #file to replace in
  Call AdvReplaceInFile                       #call find and replace
function
 
SectionEnd 
 
 
 
Function AdvReplaceInFile
         Exch $0 ;file to replace in
         Exch
         Exch $1 ;number to replace after
         Exch
         Exch 2
         Exch $2 ;replace and onwards
         Exch 2
         Exch 3
         Exch $3 ;replace with
         Exch 3
         Exch 4
         Exch $4 ;to replace
         Exch 4
         Push $5 ;minus count
         Push $6 ;universal
         Push $7 ;end string
         Push $8 ;left string
         Push $9 ;right string
         Push $R0 ;file1
         Push $R1 ;file2
         Push $R2 ;read
         Push $R3 ;universal
         Push $R4 ;count (onwards)
         Push $R5 ;count (after)
         Push $R6 ;temp file name
         GetTempFileName $R6
         FileOpen $R1 $0 r ;file to search in
         FileOpen $R0 $R6 w ;temp file
                  StrLen $R3 $4
                  StrCpy $R4 -1
                  StrCpy $R5 -1
        loop_read:
         ClearErrors
         FileRead $R1 $R2 ;read line
         IfErrors exit
         StrCpy $5 0
         StrCpy $7 $R2
 
        loop_filter:
         IntOp $5 $5 - 1
         StrCpy $6 $7 $R3 $5 ;search
         StrCmp $6 "" file_write2
         StrCmp $6 $4 0 loop_filter
 
         StrCpy $8 $7 $5 ;left part
         IntOp $6 $5 + $R3
         StrCpy $9 $7 "" $6 ;right part
         StrCpy $7 $8$3$9 ;re-join
 
         IntOp $R4 $R4 + 1
         StrCmp $2 all file_write1
         StrCmp $R4 $2 0 file_write2
         IntOp $R4 $R4 - 1
 
         IntOp $R5 $R5 + 1
         StrCmp $1 all file_write1
         StrCmp $R5 $1 0 file_write1
         IntOp $R5 $R5 - 1
         Goto file_write2
 
        file_write1:
         FileWrite $R0 $7 ;write modified line
         Goto loop_read
 
        file_write2:
         FileWrite $R0 $R2 ;write unmodified line
         Goto loop_read
 
        exit:
         FileClose $R0
         FileClose $R1
 
         SetDetailsPrint none
         Delete $0
         Rename $R6 $0
         Delete $R6
         SetDetailsPrint both
 
         Pop $R6
         Pop $R5
         Pop $R4
         Pop $R3
         Pop $R2
         Pop $R1
         Pop $R0
         Pop $9
         Pop $8
         Pop $7
         Pop $6
         Pop $5
         Pop $4
         Pop $3
         Pop $2
         Pop $1
         Pop $0
FunctionEnd
 

 
 
Thanks in advance
Tim
 
 
 
Wir fordern die Abschaffung von Gesundheitsfonds und Honorarreform in 
der aktuellen Form! 
Unterzeichnen auch Sie die Petition des Vorstandsvorsitzenden der KVB, 
Dr. Axel Munte, im Deutschen Bundestag.
(https://epetitionen.bundestag.de/index.php?action=petition;sa=details;petition=2717)
Ärzte und Psychotherapeuten brauchen adäquate Rahmenbedingungen, 
um ihre Patienten gut behandeln zu können. Dafür steht diese Petition. 
Tragen auch Sie sich heute noch ein - es geht um die Zukunft der 
qualitativ hochwertigen, wohnortnahen ambulanten Versorgung.

Disclaimer:
Bitte beachten Sie: die obige Mitteilung ist ausschließlich für die in den
Adresszeilen benannten Personen bestimmt und enthält möglicherweise 
vertrauliche Informationen. Sollten Sie diese Nachricht fälschlicherweise 
erhalten haben, informieren Sie bitte den Absender. Bitte löschen Sie 
die Nachricht und sehen Sie davon ab, die Inhalte zu nutzen, 
aufzubewahren, weiterzuleiten oder zu reproduzieren.

Viren:
Unser Unternehmen verfügt über eine funktionierende Anti-Viren- 
Software und prüft jede abgesendete Email und deren Anhänge auf 
Viren. Trotzdem können wir nicht garantieren, dass die Email virenfrei 
ist und übernehmen keine Haftung für Schäden, die aus Viren entstehen.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
mindtreeinsight-users mailing list
mindtreeinsight-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mindtreeinsight-users

Reply via email to