Another Compile Time Question
I have to go one step further with this. At compile time, I have to find filenames and use them at runtime. It would be horrible to try to hardcode this many files. Is this possible? Here's the code with a bit of pseudo thrown in:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Name "Test"
;Output File Name
OutFile "test.exe"
Section "Install"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Find any dll's to deploy, deploy them, and register them ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!system 'ECHO ;FileCheck>"%TEMP%\Temp$$$.nsh"'
!system 'IF EXIST "D:\CheckFileTest\Folder1\*.dll" ECHO !define Folder1>>"%TEMP%\Temp$$$.nsh"'
!include "$%TEMP%\Temp$$$.nsh"
!system 'DEL "%TEMP%\Temp$$$.nsh"'
!ifdef Folder1
;;;COMPILE TIME CODE;;;
!system 'dir /B "D:\CheckFileTest\Folder1\*.dll" > myFile.txt'
open myFile.txt
whileNotEndOfFile
$FileName = getLine myFile.txt
;;;RUNTIME CODE;;;
IfFileExists "$INSTDIR\$FileName" 0 new_installation
StrCpy $ALREADY_INSTALLED 1
new_installation:
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED NOREBOOT_NOTPROTECTED $FileName $INSTDIR\$FileName %TEMP%
endWhile
!endif
SectionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Thanks,
Eric