TGC Codebase Backup



DBPro Plugins Installer by Anonymous Coder

21st Nov 2004 7:38
Summary

This application does not function properly.



Description

Please anyone who's capable making a proper installation program , assist me.
Please anyone who's making licensed-free enhancements , would you please assist somehow.
EZrotate was found on the internet , and since it's not lincesed-free enhanement , you should read developer license agreement.

Thank you.



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    Rem Project: DBPro Plugins Installer
Rem Created: 15/11/2004 9:49:17 μμ

Rem ***** Main Source File *****

Width=1024
Height=768
Depth=32

`set window on
SET DISPLAY MODE Width, Height, Depth

`show window
global installer_messages$
global error$
global path_installer$
global path_launch$
global path_test$

global error$

error$="no error"

`set text font "book" :
set text size 20
set text to bold
set text transparent


path_installer$=get dir$()
path_test$="C:\Program Files\Dark Basic Software\Dark Basic Professional"

if (error$<>"exit")
   path_test:
   if (path exist(path_test$)=1)
      error$="no error"
      if (right$(path_test$,23)="Dark Basic Professional")
         path_launch$=path_test$
         set dir path_launch$
         if (FILE EXIST("Launch.exe")=1)
            print "DBPro folder found."
            print "launch.exe file found."
            print "Proceding..."
            error$="no error"
            wait 1000
            cls
         else
            EXIT PROMPT "Launch.exe file is missing.","Installation failed."
         endif
      else
         print "Installer could not find DBPro default installation path."
         path_unknown:
         error$="repeat"
         while (error$="repeat")
         print " "
         print "Please type patiently the absolute path of DBPro: "
         print "Custom installation path:"
         print "C:\Program Files\Dark Basic Software\Dark Basic Professional"
         input "?: ",path_test$
         if (path exist(path_test$)=1)then:goto path_test
         endwhile
      endif
   else
      print "Path does not exist."
      goto path_unknown
   endif
endif


if (error$="no error")
   print "DBPro Plugins Installer:"
   print "1.Install enhancement plugins pack."
   print "2.Uninstall enhancement plugins pack."
   print "3.Extend enhancement plugins pack."
   print "4.Delete enhancement plugin."
   input "Selection (1-4),<ESC> to quit:",selection
   if (selection=1) then:install_enhancement_plugins_pack():wait key
   if (selection=2) then:uninstall_enhancement_plugins_pack():wait key
   if (selection=3) then:extend_enhancement_plugins_pack():wait key
   if (selection=4) then:delete_enhancement_plugin():wait key
endif
end

function uninstall_enhancement_plugins_pack()
endfunction

function extend_enhancement_plugins_pack()
endfunction

function delete_enhancement_plugin()
endfunction


function install_enhancement_plugins_pack()
cls
print "Source Path: ",path_installer$
print "Target Path: ",path_launch$
print " "

input "Overwrite same file names? (Yes/No/Ask): ",command$
if (command$="Yes" or command$="y" or command$="Y")then:overwrite$="yes"
if (command$="No" or command$="n" or command$="N")then:overwrite$="no"
if (command$="Ask" or command$="a" or command$="A")then:overwrite$="ask"
input "Print Messages? (y/n): ",command$
if (command$="Yes" or command$="y" or command$="Y")then:messages$="on"
if (command$="No" or command$="n" or command$="N")then:messages$="off"

source_path$=path_installer$+"\command menu"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key
else
   print "Missing folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif

target_path$=path_launch$+"\Help"
if (path exist(target_path$)=1)
`   SET DIR source_path$
   installer_message$="Target path exist"
   print target_path$
   wait key
else
   print "Missing folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)



source_path$=path_installer$+"\plugins menu"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif


target_path$=path_launch$+"\Help\commands"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)


target_path$=path_launch$+"\Help\commands\plugins"
if (path exist(target_path$)=1)
   target_path$=path_launch$+"\Help\commands\plugins\plugins-licensed"
   if (path exist(target_path$)=1)
      print "Plugins-licensed folder exist."
   else
      target_path$=path_launch$+"\Help\commands\plugins"
      set dir target_path$
      make directory "plugins-licensed"
   endif
   target_path$=path_launch$+"\Help\commands\plugins\plugins-user"
   if (path exist(target_path$)=1)
      print "Plugins-user folder exist."
   else
      target_path$=path_launch$+"\Help\commands\plugins"
      set dir target_path$
      make directory "plugins-user"
   endif
else
   target_path$=path_launch$+"\Help\commands"
   set dir target_path$
   make directory "plugins"
   target_path$=path_launch$+"\Help\commands\plugins"
   set dir target_path$
   make directory "plugins-licensed"
   make directory "plugins-user"
endif

````````````````

source_path$=path_installer$+"\plugins-licensed doc"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif


target_path$=path_launch$+"\Help\commands\plugins"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)






source_path$=path_installer$+"\user index"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif
`same target
copy_directory_files(source_path$,target_path$,messages$,overwrite$)

```````````
```





target_path$=path_launch$+"\Help\commands\plugins\plugins-user"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\user index"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)


target_path$=path_launch$+"\Help\commands\plugins\plugins-licensed"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\licensed index"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif

copy_directory_files(source_path$,target_path$,messages$,overwrite$)


`````user index htm
`````licensed index htm

target_path$=path_launch$+"\Help\commands\plugins\plugins-user"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\plugins-user"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)

```
target_path$=path_launch$+"\Help\commands\plugins\plugins-licensed"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\plugins-licensed"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)

```
target_path$=path_launch$+"\Compiler\plugins-user"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\user dll files"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)
```
target_path$=path_launch$+"\Compiler\plugins-licensed"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\licensed dll files"
if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif
copy_directory_files(source_path$,target_path$,messages$,overwrite$)
`dll



target_path$=path_launch$+"\Editor\Keywords"
if (path exist(target_path$)=1)
   installer_message$="Target path exist"
   print target_path$
   wait key````````````````````````
else
   print "Missing target folder."
   print "Installation failed."
   installer_message$="Target path missing"
   error$="exit"
endif

source_path$=path_installer$+"\ini files"

if (path exist(source_path$)=1)
   installer_message$="Source path exist"
   print source_path$
   wait key````````````````````````
else
   print "Missing source folder."
   print "Installation failed."
   installer_message$="Source path missing"
   error$="exit"
endif

copy_directory_files(source_path$,target_path$,messages$,overwrite$)

```




if (installer_messages$="Installation complete")
   print "Installation complete."
else
   print installer_messages$
endif

endfunction





`function get_file_name(directory$,extension$,application_name$)
`find first
`repeat
`if get file type()=0 and get file name$()<> application_name$
`   files$=get file name$()
`   if right$(files$, 3) = extension$ then : if (copy file files$,directory$=1)then:print files$," copied.":copy_file_to_registry(application_name$, entension$, files$)
`endif
`find next
`until get file type()=-1
`wait key
`endfunction


function copy_directory_files(source$,target$,messages$,overwrite$)
if (source$<>"null" or source$<>"")
   set dir source$
else
   print "'print_directory_files(target$)' function error. Parameter 'target$' missing."
endif

find first
   repeat
      if get file type()=0 and get file name$()<> "DBPro Plugins Installer.exe"
         file$=get file name$()
         if (messages$="on") then: print file$
         if (overwrite$="yes")
            if (file exist(target$+"\"+file$))
               delete file target$+"\"+file$
               COPY FILE file$,target$+"\"+file$
               files=files+1
            endif
         endif
         if (overwrite$="no")
            if (file exist(target$+"\"+file$))
               print file$," already exist..."
            else
               COPY FILE file$,target$+"\"+file$
               files=files+1
            endif
         endif
         if (overwrite$="ask")
            if (file exist(target$+"\"+file$))
               input "Overwrite/Rename? (o/r): ",command$
               if (command$="o")
                  delete file target$+"\"+file$
                  COPY FILE file$,target$+"\"+file$
                  files=files+1
               endif
               if (command$="r")
                  input "Please enter a new file name with its extension: ",filename$
                  if (right$(filename$,4)=".htm")
                     rename file target$+"\"+file$,target$+"\"+filename$
                  else
                     input right$(filename$,4) ," extension seems unfamiliar. Continue anyway? (y/n): ",command$
                     if (command$="y")
                        rename file target$+"\"+file$,target$+"\"+filename$
                     else
                        print "File was left intact."
                     endif
                  endif
               endif
            endif
         endif
      endif
   find next
until get file type()=-1
if (messages$="on") then: print files," files copied."
endfunction