Custom page shows if files doesn't exist
Hi there is there a better way to script this, it seem a bit messy
Basically if the file doesn't exist it shows the custom page warning people it will be installed and run an *.inf file via a *.bat to install these drivers (I say warning as the drivers aren't officially passed by Microsoft, thus the warning not to worry and so on)
if the file does exist the custom page doesn't show and the drivers are not installed
Page custom Mpeg
Function Mpeg
IfFileExists "$SYSDIR\Mpg4dmod.dll.bak" MpegSkip MpegShow
MpegShow:
!insertmacro MUI_HEADER_TEXT "$(TEXT_IO_TITLE)" "$(TEXT_IO_SUBTITLE)"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "mpeg21.ini"
CreateDirectory "$INSTDIR\Mpeg"
SetFileAttributes "$INSTDIR\Mpeg" HIDDEN
SetOutPath "$INSTDIR\Mpeg"
File "Mpeg\Mpeg.bat"
File "Mpeg\msaud32.acm"
File "Mpeg\MPG4c32.dll"
File "Mpeg\MPG4ds32.ax"
File "Mpeg\msadds32.ax"
File "Mpeg\MS-MPG4.inf"
IfFileExists "$SYSDIR\Mpg4dmod.dll.bak" 0 +2
Delete "$SYSDIR\Mpg4dmod.dll.bak"
IfFileExists "$SYSDIR\Mpg4dmod.dll" 0 +2
Rename "$SYSDIR\Mpg4dmod.dll" "$SYSDIR\Mpg4dmod.dll.bak"
IfFileExists "$SYSDIR\dllcache\Mpg4dmod.dll.bak" 0 +2
Delete "$SYSDIR\dllcache\Mpg4dmod.dll.bak"
IfFileExists "$SYSDIR\dllcache\Mpg4dmod.dll" 0 +2
Rename "$SYSDIR\dllcache\Mpg4dmod.dll" "$SYSDIR\dllcache\Mpg4dmod.dll.bak"
nsExec::Exec '"$INSTDIR\Mpeg\Mpeg.bat"'
SetOutPath "$INSTDIR"
RMDir /r "$INSTDIR\Mpeg"
SetOutPath "$SYSDIR"
File "Mpeg\Mpg4dmod.dll.bak"
MpegSkip:
FunctionEnd
At the moment the files install when you click out of the custom page to go to the install page, but the install page doesn't show until the drivers have finished installing, which is messy
What I would like is this
If file doesn't exist, show custom page but install the drivers with the main installation files
I know how to do this if I where to have it selectable in the components page, you know if it was selected the page would show the files wouldn't be installed and visa versa
but I want to do this so people don't have that option, once the drivers are installed, the page wouldn't show again as its a one off thing
Please help
and thanks