Went the VBS route, attached my vbs in case its any use to anyone else :
Code: Select all
Function WriteToLog(TextToWrite)
Const MsgType = &H04000000
Set rec = Installer.CreateRecord(1)
rec.StringData(1) = TextToWrite
Session.Message MsgType, rec
'Msgbox TextToWrite
WriteToLog = 0
End Function
Function CheckForScreens()
Dim fso, msg, objFSO, objFolder,colFiles,counted,temp, Installdir
Installdir=Session.Property("APPDIR")&"Settings\Screens"
Set fso = CreateObject("Scripting.FileSystemObject")
counted=0
WriteToLog("CheckForScreens: Looking for "&Installdir)
If (fso.FolderExists(Installdir)) Then
WriteToLog("CheckForScreens: Found existing screens folder, checking contents..")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Installdir)
Set colFiles = objFolder.Files
For Each objFile in colFiles
WriteToLog("CheckForScreens: found "&objFile.Name)
' only count XML files, as these are the ones we're interested in
If UCase(Right(objFile.Name,3))="XML" then
counted=counted+1
End if
Next
WriteToLog("CheckForScreens: found "&Cstr(counted)&" XML screens")
if counted > 0 then
WriteToLog("CheckForScreens: returned=0")
Session.Property("APERTA_DEFAULTSCREENSEMPTY")="0"
else
WriteToLog("CheckForScreens: returned=1")
Session.Property("APERTA_DEFAULTSCREENSEMPTY")="1"
end if
Else
WriteToLog("CheckForScreens: returned=1")
Session.Property("APERTA_DEFAULTSCREENSEMPTY")="1"
End If
End Function
FOLLOW US
Get the latest news in Application Packaging