Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File Existing
#1
Im working with that DLL Register tut but im trying to make it check to see if it already exist and if not register the provided files in a specific folder.

i want it to do is like Check the C:\WINDOWS\System32\name.dll but idk how :\

heres my function tho..

Code:
Function SystemFileExist(ByVal SystemFileName As String) As Boolean
    If Dir("C:" & "\" & SystemFileName) = "" Then
        SystemFileExist = False
    Else
        SystemFileExist = True
    End If
End Function
Reply
#2
Got it to work but its not registering the files if its not there >.>

Heres my sub load in main menu

Code:
Private Sub Form_Load()
If SystemFileExist("dx7vb.dll") And SystemFileExist("msstdfmt.dll") And SystemFileExist("MSCOMCTL.ocx") And SystemFileExist("MSWINSCK.ocx") And SystemFileExist("richtx32.ocx") And SystemFileExist("TABCTL3N.ocx") Then
Call MsgBox("Game loaded successfull!")
Else
DLL_Register App.Path & "\Extras\register-files\dx7vb.dll"
DLL_Register App.Path & "\Extsras\register-files\msstdfmt.dll"
DLL_Register App.Path & "\Extras\register-files\MSCOMCTL.ocx"
DLL_Register App.Path & "\Extras\register-files\MSWINSCK.ocx"
DLL_Register App.Path & "\Extras\register-files\richtx32.ocx"
DLL_Register App.Path & "\Extras\register-files\TABCTL3N.ocx"
Call MsgBox("The registery files have registered successfull!")
End If
End Sub

and heres my fixed function...

Code:
Function SystemFileExist(ByVal SystemFileName As String) As Boolean
    If Dir("C:" & "\WINDOWS\System32\" & SystemFileName) = "" Then
        SystemFileExist = False
    Else
        SystemFileExist = True
    End If
End Function
Reply
#3
I think you can grab the system directory from the registry. Non-NT users (98 and below) used \System\ not \System32\, along with not everyone has their windows drive on C:\.
Reply
#4
ya i can always make it check there and if nto there then another drive such as D:\ xD but most people have XP +
Reply
#5
yea but when you install xp, you can change what drive its installed on, and you could also use disk management to change drive letters.

Of course you could always read the filepaths saved in registry for system folder, then problem would be solved (You know how it stores path to your documents, program files, temp folder etc)
Reply
#6
ya but it wouldn't know that it's registered... but wats weird is when u register a dll, it doesn't add it into system32 folder, i just found that out :x
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)