| Mirage Source http://miragesource.net/forums/ |
|
| File Existing http://miragesource.net/forums/viewtopic.php?f=201&t=1703 |
Page 1 of 1 |
| Author: | Da Undead [ Sat Apr 21, 2007 3:17 pm ] |
| Post subject: | File Existing |
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 |
|
| Author: | Da Undead [ Sat Apr 21, 2007 3:23 pm ] |
| Post subject: | |
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 |
|
| Author: | Spodi [ Sat Apr 21, 2007 6:03 pm ] |
| Post subject: | |
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:\. |
|
| Author: | Da Undead [ Sat Apr 21, 2007 11:47 pm ] |
| Post subject: | |
ya i can always make it check there and if nto there then another drive such as D:\ xD but most people have XP + |
|
| Author: | funkynut [ Sun Apr 22, 2007 12:01 am ] |
| Post subject: | |
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) |
|
| Author: | Da Undead [ Sun Apr 22, 2007 1:07 am ] |
| Post subject: | |
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 |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|