i want to thank every one that help me with some of the problems i had
even though the name isn't to unquie (it my name spelt backwards) i plan to do alot in the future.
this is it current features for the creator
- *user customizable display name
*customizable window title (shared)
*customizable default install location
*option to show a agreement
*option to ask to see the readme at the end
*show the space requirements (for small apps)
*compression level (for the pack holsing the files)
*backround image
*auto file/folder structure creator
*an option to use a dll to render a synamic backround(this isn't implatmeted on the installer side)
- *alot more options as side bar (1-4) locations
*allow packing of all files into the pack insted of all of them outside
*backround music
*transparent windows?
*a mini installer option (compact and less wizard like)
*installer templates for windows
*mini gui builder for the templates
*install cancel
*muilt-langs
*serail key?
*links for email and web address to the author
*encryption to the pack
*registry actions
*start menu options
*desktop icon
*window users options aka "install for me or for everyone"
*the use of rings fast file lib
*splitter for muilt cd/zip/floppy
thats it for that list for now.
since this is a beta there are a couple of bugs i can't seam to figure out and some i haven't even found out yet if you find any please inform me and if you like please post the snip of the fixing code (yes please)
the only bug i know for this is that the progressbars are all wacked out even though the packercall back code seams to be just fine :roll:
so finnally here is the creator code
Code: Select all
;/////////////////////////////////////////////////////////////////
;/Rolgerd Install creator version 1.0 BETA
;/Created by Dreglor
;/Created on June 23
;/Last updated on July 5
;/////////////////////////////////////////////////////////////////
;*-----------------------------------------------------------------
;-Declares
;*-----------------------------------------------------------------
Declare Count_Files(id,path.s)
Declare Create_List(id,path.s)
Declare Pack_Files(id,path.s)
Declare Peer_Directory(id,path.s)
Declare OpenWin_Main()
Declare ControlWin_Main()
Declare OpenWin_Beta()
Declare ControlWin_Beta()
Declare OpenWin_Progress()
Declare Pack_CallBack(SP,DP)
Declare ControlWin_Progress()
Declare BalloonTip(WindowID,Gadget,Text$,Title$,Icon)
Declare ReadCatalog(Filename$)
;*-----------------------------------------------------------------
;-Constants
;*-----------------------------------------------------------------
#Title="Rolgerd Install Creator"
#Version="1.0 Beta"
#MR_Yes=6
#MR_No=7
#TOOLTIP_NO_ICON = 0
#TOOLTIP_INFO_ICON = 1
#TOOLTIP_WARNING_ICON = 2
#TOOLTIP_ERROR_ICON = 3
#Win_Main=0
Enumeration ;gadgets
#Gad_Frame_0
#Gad_Frame_1
#Gad_AppName
#Text_0
#Gad_Ilis_Struc
#Gad_Str_Title
#Text_2
#Gad_Str_Def
#Text_3
#Gad_Chk_Term
#Gad_Chk_Req
#Gad_Chk_Read
#Gad_But_Prev
#Gad_Str_Src
#Gad_But_Brw
#Text_5
#Gad_Txt_Phase
#Gad_Txt_Current
#Gad_Trk_Com
#Text_6
#Gad_Txt_Coml
#Gad_Prg_Cur
#Gad_Txt_Perc
#Gad_Prg_All
#Gad_Txt_Pera
#Gad_Chk_dll
#Gad_But_Crl
#Gad_Str_Img
#Text_12
#Gad_But_Create
EndEnumeration
;*-----------------------------------------------------------------
;-Globals
;*-----------------------------------------------------------------
Dim Language$(17)
Global dir.s
Global foldertotal.w
Global filetotal.w
Global bsize.l
Global com.b
Global pc.w
Global en.s
;*-----------------------------------------------------------------
;-Procedures
;*-----------------------------------------------------------------
Procedure Count_Files(id,path.s)
If Right(path,1)<>"\" ;makes the format more "relaxing"
path+"\"
EndIf
ExamineDirectory(id,path,"*.*")
de=NextDirectoryEntry()
Repeat
en.s=DirectoryEntryName()
Select de
Case 1 ;file
bsize=bsize+DirectoryEntrySize()
filetotal=filetotal+1
AddGadgetItem(#Gad_Ilis_Struc,-1,"Create File"+Chr(10)+en)
Debug path+en
Case 2 ;folder
If en<>"." And en<>".."
AddGadgetItem(#Gad_Ilis_Struc,-1,"Open Directory"+Chr(10)+en)
foldertotal=foldertotal+1
Debug path+en
Count_Files(foldertotal,path+en+"\")
AddGadgetItem(#Gad_Ilis_Struc,-1,"Close Directory"+Chr(10)+en)
UseDirectory(id)
EndIf
EndSelect
de=NextDirectoryEntry()
Until de=0
EndProcedure
Procedure Create_List(id,path.s)
If Right(path,1)<>"\" ;makes the format more "relaxing"
path+"\"
EndIf
ExamineDirectory(id,path,"*.*")
de=NextDirectoryEntry()
Repeat
en.s=DirectoryEntryName()
Select de
Case 1 ;file
WriteStringN("FN "+en)
Debug path+en
Case 2 ;folder
If en<>"." And en<>".."
WriteStringN("OD "+en)
Debug path+en
Create_List(id+1,path+en+"\")
WriteStringN("CD "+en)
UseDirectory(id)
EndIf
EndSelect
de=NextDirectoryEntry()
Until de=0
EndProcedure
Procedure Pack_Files(id,path.s)
If Right(path,1)<>"\" ;makes the format more "relaxing"
path+"\"
EndIf
ExamineDirectory(id,path,"*.*")
de=NextDirectoryEntry()
Repeat
en.s=DirectoryEntryName()
Select de
Case 1 ;file
AddPackFile(path+en,com)
pc+1
Debug path+en
Case 2 ;folder
If en<>"." And en<>".."
Debug path+en
Pack_Files(id+1,path+en+"\")
UseDirectory(id)
EndIf
EndSelect
de=NextDirectoryEntry()
Until de=0
EndProcedure
Procedure ReadCatalog(Filename$)
If ReadFile(0, Filename$)
If ReadString() = "Catalog"
For k=0 To 17
Language$(k) = ReadString()
Next
EndIf
CloseFile(0)
EndIf
EndProcedure
;*-----------------------------------------------------------------
;-Windows
;*-----------------------------------------------------------------
Procedure Open_Win_Main()
If OpenWindow(#Win_Main, 123, 370, 750, 320, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered , "Pure Installer 1.0 BETA")
If CreateGadgetList(WindowID())
Frame3DGadget(#Gad_Frame_0, 10, 0, 280, 180, "Installer options")
Frame3DGadget(#Gad_Frame_1, 300, 0, 440, 310, "Creation Options")
StringGadget(#Gad_AppName, 20, 20, 140, 20, "My App")
TextGadget(#Text_0, 170, 20, 70, 20, "Display name")
ListIconGadget(#Gad_Ilis_Struc, 320, 20, 410, 140, "Action", 100, #PB_ListIcon_FullRowSelect)
AddGadgetColumn(#Gad_Ilis_Struc, 2, "Value", 306)
StringGadget(#Gad_Str_Title, 20, 50, 140, 20, "My App Install")
TextGadget(#Text_2, 170, 50, 60, 20, "Window title")
StringGadget(#Gad_Str_Def, 20, 80, 140, 20,"C:\Program Files\")
TextGadget(#Text_3, 170, 80, 110, 20, "Default install location")
CheckBoxGadget(#Gad_Chk_Term, 20, 110, 90, 20, "Display terms")
CheckBoxGadget(#Gad_Chk_Req, 20, 140, 140, 20, "Show space requiments")
CheckBoxGadget(#Gad_Chk_Read, 110, 110, 110, 20, "Ask to read readme")
ButtonGadget(#Gad_But_Prev, 160, 140, 120, 30, "Preview Installer")
StringGadget(#Gad_Str_Src, 320, 170, 250, 20, "C:\")
ButtonGadget(#Gad_But_Brw, 580, 170, 40, 20, "Browse")
TextGadget(#Text_5, 630, 170, 80, 20, "Source directory")
TextGadget(#Gad_Txt_Phase, 10, 190, 280, 20, "Nothing", #PB_Text_Center)
TextGadget(#Gad_Txt_Current, 10, 210, 280, 20, "Nothing", #PB_Text_Center)
TrackBarGadget(#Gad_Trk_Com, 320, 210, 250, 20, 1, 9, #PB_TrackBar_Ticks)
TextGadget(#Text_6, 580, 210, 100, 20, "Compression Level is ")
TextGadget(#Gad_Txt_Coml, 682, 210, 10, 20, "1")
ProgressBarGadget(#Gad_Prg_Cur, 10, 230, 240, 20, 0, 100)
TextGadget(#Gad_Txt_Perc, 260, 230, 30, 20, "0%")
ProgressBarGadget(#Gad_Prg_All, 10, 250, 240, 20, 0, 100)
TextGadget(#Gad_Txt_Pera, 260, 250, 30, 20, "0%")
CheckBoxGadget(#Gad_Chk_dll, 320, 270, 210, 20, "Use Dll to render a dynamic backround")
ButtonGadget(#Gad_But_Crl, 550, 270, 180, 30, "Create File Sturcture From Source")
StringGadget(#Gad_Str_Img, 320, 240, 250, 20, "back.bmp")
TextGadget(#Text_12, 580, 240, 90, 20, "Backround image")
ButtonGadget(#Gad_But_Create, 10, 280, 280, 30, "Create Installer", #PB_Button_Default)
EndIf
EndIf
EndProcedure
Procedure Pack_CallBack(SP,DP)
SetGadgetState(#Gad_Prg_Cur,SP/DP*100)
SetGadgetState(#Gad_Prg_All,pc/(foldertotal+filetotal)*100)
SetGadgetText(#Gad_Txt_Perc,Str(SP/DP*100)+"%")
SetGadgetText(#Gad_Txt_Pera,Str(pc/(foldertotal+filetotal)*100)+"%")
SetGadgetText(#Gad_Txt_Current,en)
WindowEvent()
EndProcedure
;*-----------------------------------------------------------------
;-Entry Point
;*-----------------------------------------------------------------
Restore BaseLanguage
For k=0 To 17
Read Language$(k)
Next
Open_Win_Main()
Repeat
restart:
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Gad_But_Prev
;unimplamented
ElseIf GadgetID = #Gad_Str_Def
If Right(GetGadgetText(#Gad_Str_Def),1)<>"\"
SetGadgetText(#Gad_Str_Def,GetGadgetText(#Gad_Str_Def)+"\")
EndIf
ElseIf GadgetID = #Gad_Str_Img
If Left(GetGadgetText(#Gad_Str_Img),1)="\"
temp.s=GetGadgetText(#Gad_Str_Img)
SetGadgetText(#Gad_Str_Img,PeekS(@temp+1))
EndIf
ElseIf GadgetID = #Gad_Trk_Com
SetGadgetText(#Gad_Txt_Coml,Str(GetGadgetState(#Gad_Trk_Com)))
ElseIf GadgetID = #Gad_But_Brw
SetGadgetText(#Gad_Str_Src,PathRequester("Source Directory",GetGadgetText(#Gad_Str_Src)))
ElseIf GadgetID = #Gad_But_Crl
Count_Files(0,GetGadgetText(#Gad_Str_Src))
MessageRequester("Info","There are "+Str(foldertotal)+" Directorys and "+Str(filetotal)+" Files, totaling "+Str(bsize/1048576)+" Megabytes")
ready=1
ElseIf GadgetID = #Gad_But_Create
If ready=1
Debug foldertotal
Debug filetotal
SetGadgetText(#Gad_Txt_Phase,"Creating Installer Please Wait")
DeleteFile("rip.lst");kill bad lst files
OpenFile(0,"rip.lst")
WriteStringN(GetGadgetText(#Gad_AppName))
WriteStringN(GetGadgetText(#Gad_Str_Title))
WriteStringN(GetGadgetText(#Gad_Str_Def))
WriteStringN(Str(GetGadgetState(#Gad_Chk_Term)))
WriteStringN(Str(GetGadgetState(#Gad_Chk_Req)))
WriteStringN(Str(GetGadgetState(#Gad_Chk_Read)))
WriteStringN(Str(GetGadgetState(#Gad_Chk_dll)))
If GetGadgetState(#Gad_Chk_dll)=0
WriteStringN(GetGadgetText(#Gad_Str_Img))
EndIf
WriteStringN(Str(foldertotal))
WriteStringN(Str(filetotal))
WriteStringN(Str(bsize))
com=GetGadgetState(#Gad_Trk_Com)
Create_List(0,GetGadgetText(#Gad_Str_Src))
CloseFile(0)
PackerCallback(@Pack_CallBack())
DeleteFile("main.rip");kill old/corrupt files
CreatePack("main.rip")
;Debug AddPackFile("rip.lst",9)
;Debug "^^^ thats result of 'addpackfile'"
;DeleteFile("rip.lst");comment this out for debugging
Pack_Files(0,GetGadgetText(#Gad_Str_Src))
SetGadgetText(#Gad_Txt_Pera,"0%")
SetGadgetText(#Gad_Txt_Perc,"0%")
SetGadgetState(#Gad_Prg_Cur,0)
SetGadgetState(#Gad_Prg_All,0)
SetGadgetText(#Gad_Txt_Current,"Nothing")
SetGadgetText(#Gad_Txt_Phase,"Nothing")
pc=0
ClosePack()
CreateDirectory(GetGadgetText(#Gad_AppName))
CopyFile("installer.exe",GetGadgetText(#Gad_AppName)+"\installer.exe")
CopyFile("main.rip",GetGadgetText(#Gad_AppName)+"\main.rip")
CopyFile("rip.lst",GetGadgetText(#Gad_AppName)+"\rip.lst")
MessageRequester("Info","Installer Created"+Chr(10)+"Please send Dreglor@comcast.net any comments/bugs/suggestions :)")
Else
MessageRequester("Error","Theres nothing to pack!")
EndIf
EndIf
EndIf
Until Event = #PB_EventCloseWindow
End
;*-----------------------------------------------------------------
;-Data
;*-----------------------------------------------------------------
DataSection
BaseLanguage:
Data$ "Installer options"
Data$ "Creation Options"
Data$ "Display name"
Data$ "Action"
Data$ "Value"
Data$ "Window title"
Data$ "Default install location"
Data$ "Display terms"
Data$ "Show space requiments"
Data$ "Ask to read readme"
Data$ "Preview Installer"
Data$ "Browse"
Data$ "Source directory"
Data$ "Compression Level is "
Data$ "Use Dll to render a dynamic backround"
Data$ "Create Sturcture From Source"
Data$ "Backround image"
Data$ "Create Installer"
EndDataSection
there are some bigger bugs in this part sadly
the backround doesn't seam to even display anything
and progress bars are not even working nor is the text thats in the same procedure (the packer call back procedure)
now for the installer code
Code: Select all
;/////////////////////////////////////////////////////////////////
;/Rolgerd Installer version 1.0 BETA
;/Created by Dreglor
;/Created on June 23
;/Last updated on July 5
;/////////////////////////////////////////////////////////////////
;*-----------------------------------------------------------------
;-Declares
;*-----------------------------------------------------------------
Declare unpackcallback(sb,db)
Declare Getinfo()
Declare.s stepback(path.s)
Declare checkdir(path.s)
Declare install(path.s)
Declare get_HD_space(drive.s)
Declare Open_win_intro()
Declare Open_Win_Agree()
Declare Open_Win_Location()
Declare Open_Win_Background()
Declare Open_Win_Progress()
Declare Open_Win_Fin()
;*-----------------------------------------------------------------
;-Structures
;*-----------------------------------------------------------------
Structure Quad
L1.l
L2.l
EndStructure
;*-----------------------------------------------------------------
;-Constants
;*-----------------------------------------------------------------
#Title="Rolgerd Installer"
#Version="1.0 Beta"
#MR_Yes=6
#MR_No=7
Enumeration;windows
#win_intro
#Win_Agree
#Win_Location
#Win_Background
#Win_Progress
#Win_Fin
EndEnumeration
Enumeration;gadgets
#Gad_Img_Side
#Gad_Txt_Intro
#Text_1
#Frame3D_1
#Gad_But_End
#Gad_But_Next1
#Gad_Img_Side2
#Gad_Txt_Agree
#Text_2
#Frame3D_2
#Gad_But_Back1
#Gad_But_Next2
#Gad_Edt_Agree
#Gad_Rad_Do
#Gad_Rad_dont
#Gad_Img_Side3
#Text_3
#Text_4
#Frame3D_3
#Gad_But_Back2
#Gad_But_Next3
#Gad_Str_Loc
#Gad_But_Brw
#Text_Txt_Space
#Gad_Prg_Overall
#Gad_Prg_Current
#Gad_Onfile
#Text_5
#Gad_Txt_Curr
#Gad_Txt_Over
#Gad_Img_Side4
#Gad_Chk_Read
#Text_6
#Frame3D_4
#Gad_But_Fin
#Gad_Img_Back
EndEnumeration
;*-----------------------------------------------------------------
;-Globals
;*-----------------------------------------------------------------
Global TotalMB.l
Global FreeMB.l
Global UsedMB.l
Global agree.b
Global appname.s
Global def.s
Global installto.s
Global readme.b
Global title.s
Global bsize.l
Global files.w
Global folders.w
Global showspace.b
Global tempdir.s
Global dback.b
Global backimg.s
Global totalitems.l
Global onitem.l
Global sw.l
Global sh.l
appname="My Program"
def="C:\"
installto="C:\"
title="My Program Version 1.0"
sw=GetSystemMetrics_(#SM_CXSCREEN)
sh=GetSystemMetrics_(#SM_CYSCREEN)
tempdir.s="C:\Programs"
;*-----------------------------------------------------------------
;-Arrays
;*-----------------------------------------------------------------
;nothing here
;*-----------------------------------------------------------------
;-Procedures
;*-----------------------------------------------------------------
Procedure get_HD_space(drive.s)
GetDiskFreeSpaceEx_(@drive, FB.Quad, TB.Quad, TFB.Quad)
If TB\L1 & $80000000
TB\L1 & $7FFFFFFF
TB\L1>>20
TB\L1 + $800
TB\L2<<12
Else
TB\L1>>20
TB\L2<<12
EndIf
TotalMB.l = TB\L1 + TB\L2
If TFB\L1 & $80000000
TFB\L1 & $7FFFFFFF
TFB\L1>>20
TFB\L1 + $800
TFB\L2<<12
Else
TFB\L1>>20
TFB\L2<<12
EndIf
FreeMB.l = TFB\L1 + TFB\L2
UsedMB.l = TotalMB - FreeMB
EndProcedure
Procedure.s EnvVar(variable$)
result$=Space(512)
res=GetEnvironmentVariable_(variable$,@result$,512)
If res
ProcedureReturn result$
Else
ProcedureReturn ""
EndIf
EndProcedure
Procedure Getinfo()
OpenFile(0,"rip.lst")
;get options
appname=ReadString()
title=ReadString()
def=ReadString()
agree=Val(ReadString())
showspace=Val(ReadString())
readme=Val(ReadString())
dback=Val(ReadString())
If dback=0
backimg=ReadString()
EndIf
folders=Val(ReadString())
files=Val(ReadString())
bsize=Val(ReadString())/1048576
totalitems=folders+files
CloseFile(0)
EndProcedure
Procedure unpackcallback(sb,db)
SetGadgetState(#Gad_Prg_Overall,onitem/totalitems*100)
SetGadgetState(#Gad_Prg_Current,sb/db*100)
SetGadgetText(#Gad_Txt_Over,Str(onitem/totalitems*100)+"%")
SetGadgetText(#Gad_Txt_Curr,Str(sb/db*100)+"%")
EndProcedure
Procedure.s stepback(path.s)
Repeat
slash=FindString(path,"\",oldslash+1)
Debug slash
If slash=0
ProcedureReturn PeekS(@path,oldslash-1)
EndIf
oldslash=slash
ForEver
EndProcedure
Procedure checkdir(path$)
If FileSize(path$)=-2
If MessageRequester("Info","The Directory already exists are you sure you want to install your files there?",#PB_MessageRequester_YesNo)=#MR_No
ProcedureReturn 0
Else
ProcedureReturn 1
EndIf
Else
If MessageRequester("Info","The Directory Doesn't exists are you sure you want to install your files there?",#PB_MessageRequester_YesNo)=#MR_No
ProcedureReturn 0
Else
Debug path$
Debug MakeSureDirectoryPathExists_(path$)
ProcedureReturn 1
EndIf
EndIf
EndProcedure
Procedure install(path.s)
OpenFile(0,"rip.lst")
OpenPack("main.rip")
PackerCallback(@unpackcallback())
Debug ReadString()
Debug ReadString()
Debug ReadString()
Debug ReadString()
Debug ReadString()
Debug ReadString()
Debug ReadString()
If dback=0
Debug ReadString()
EndIf
Debug ReadString()
Debug ReadString()
Debug ReadString()
For onitem=0 To totalitems
UseFile(0)
Str.s=ReadString()
Debug Str.s
If PeekS(@Str,2)="OD"
CreateDirectory(path+"\"+PeekS(@Str+3))
path=path+"\"+PeekS(@Str+3)
Debug "OD: "+path
ElseIf PeekS(@Str,2)="CD"
path=stepback(path)
Debug "CD: "+path
ElseIf PeekS(@Str,2)="FN"
OpenFile(1,path+"\"+PeekS(@Str+3))
Debug "CF: "+PeekS(@Str+3)
*Mem=NextPackFile()
len=PackFileSize()
For f=0 To len
WriteByte(PeekB(*Mem+f))
Next
CloseFile(1)
EndIf
Next
EndProcedure
;*-----------------------------------------------------------------
;-Windows
;*-----------------------------------------------------------------
Procedure Open_win_intro()
If OpenWindow(#win_intro, 2, 1, 600, 300,#PB_Window_ScreenCentered,"Pure Installer - "+title)
If CreateGadgetList(WindowID())
ImageGadget(#Gad_Img_Side, 10, 10, 100, 280, LoadImage(0, "side1.bmp"), #PB_Image_Border)
TextGadget(#Gad_Txt_Intro, 130, 10, 440, 30, "Thank you for Installing "+appname+". Rolgerd Install will now Guide you through the process of installing this Program")
TextGadget(#Text_1, 130, 210, 120, 20, "Click "+Chr(34)+"Next"+Chr(34)+" To Continue")
Frame3DGadget(#Frame3D_1, 120, 240, 470, 50, "")
ButtonGadget(#Gad_But_End, 130, 260, 80, 20, "Quit", #PB_Button_Default)
ButtonGadget(#Gad_But_Next1, 230, 260, 80, 20, "Next")
EndIf
EndIf
EndProcedure
Procedure Open_Win_Agree()
If OpenWindow(#Win_Agree, 2, 1, 600, 300,#PB_Window_ScreenCentered, "Rolgerd Installer - "+title)
If CreateGadgetList(WindowID())
ImageGadget(#Gad_Img_Side2, 490, 10, 100, 280, LoadImage(1, "side2.bmp"), #PB_Image_Border)
TextGadget(#Gad_Txt_Agree, 10, 10, 270, 20, "Please Read the agreement and Agree before Installing")
TextGadget(#Text_2, 10, 220, 120, 20, "Click "+Chr(34)+"Next"+Chr(34)+" To Continue")
Frame3DGadget(#Frame3D_2, 10, 240, 460, 50, "")
ButtonGadget(#Gad_But_Back1, 20, 260, 80, 20, "Back", #PB_Button_Default)
ButtonGadget(#Gad_But_Next2, 290, 260, 80, 20, "Next", #PB_Button_Default)
EditorGadget(#Gad_Edt_Agree, 10, 30, 460, 180)
If OpenFile(0,"Agreement.txt")<>0
i=0
While Eof(0)=0
AddGadgetItem(#Gad_Edt_Agree,i,ReadString())
i+1
Wend
Else
MessageRequester("Error","No agreement file, halting installer")
End
EndIf
OptionGadget(#Gad_Rad_Do, 220, 260, 60, 20, "I Agree")
OptionGadget(#Gad_Rad_dont, 110, 260, 90, 20, "I Don't Agree")
DisableGadget(#Gad_Edt_Agree,1)
DisableGadget(#Gad_But_Next2,1)
SetGadgetState(#Gad_Rad_dont,1)
EndIf
EndIf
EndProcedure
Procedure Open_Win_Location()
If OpenWindow(#Win_Location, 2, 1, 600, 300,#PB_Window_ScreenCentered, "Pure Installer - "+title)
If CreateGadgetList(WindowID())
ImageGadget(#Gad_Img_Side3, 10, 10, 580, 80, LoadImage(2, "\side3.bmp"), #PB_Image_Border)
TextGadget(#Text_3, 10, 100, 170, 20, "Please Enter the Location to install")
TextGadget(#Text_4, 10, 220, 120, 20, "Click "+Chr(34)+"Next"+Chr(34)+" To Continue")
Frame3DGadget(#Frame3D_3, 10, 240, 580, 50, "")
ButtonGadget(#Gad_But_Back2, 20, 260, 80, 20, "Back", #PB_Button_Default)
ButtonGadget(#Gad_But_Next3, 110, 260, 80, 20, "Next", #PB_Button_Default)
StringGadget(#Gad_Str_Loc, 10, 190, 510, 20, def)
ButtonGadget(#Gad_But_Brw, 530, 190, 60, 20, "Browse")
;Debug PeekS(GetGadgetText(#Gad_Str_Loc),3)
If showspace=1
Str.s=GetGadgetText(#Gad_Str_Loc)
get_HD_space(PeekS(@Str,3))
TextGadget(#Text_Txt_Space, 10, 130, 260, 40, "Space Available: "+Str(FreeMB)+"MB"+Chr(10)+"Space Required: "+Str(bsize)+"MB"+Chr(10)+"Space After: "+Str(FreeMB-bsize)+"MB")
EndIf
EndIf
EndIf
EndProcedure
Procedure Open_Win_Background()
OpenWindow(#Win_Background,0,0,sw,sh,#PB_Window_BorderLess|#PB_Window_ScreenCentered,"Rolgerd Installer Backround")
If dback=1
If OpenLibrary(0,"DynBack.dll")
;CallFunction(0,"MainLoop",#Win_Background,sw,sh) ;not implamented yet nor is it tested
EndIf
Else
LoadImage(0,backimg)
id=ResizeImage(0,sw,sh)
ImageGadget(#Gad_Img_Back,0,0,sw,sh,id)
WindowEvent()
EndIf
EndProcedure
Procedure Open_Win_Progress()
If OpenWindow(#Win_Progress, 238, 319, 600, 100,#PB_Window_ScreenCentered, "Rolgerd Installer - "+title)
If CreateGadgetList(WindowID())
ProgressBarGadget(#Gad_Prg_Overall, 10, 70, 540, 20, 0, 10)
ProgressBarGadget(#Gad_Prg_Current, 10, 50, 540, 20, 0, 10)
TextGadget(#Gad_Onfile, 10, 30, 580, 20, "", #PB_Text_Center)
TextGadget(#Text_5, 10, 0, 580, 20, "Installing. Please wait while files are being copied")
TextGadget(#Gad_Txt_Curr, 560, 50, 30, 20, "0%")
TextGadget(#Gad_Txt_Over, 560, 70, 30, 20, "0%")
EndIf
EndIf
EndProcedure
Procedure Open_Win_Fin()
If OpenWindow(#win_intro, 260, 128, 600, 300,#PB_Window_ScreenCentered, "Pure Installer - "+title)
If CreateGadgetList(WindowID())
ImageGadget(#Gad_Img_Side3, 0, 200, 600, 100, LoadImage(0, "\side4.bmp"), #PB_Image_Border)
If readme=1
CheckBoxGadget(#Gad_Chk_Read, 10, 110, 190, 20, "Read the readme?")
EndIf
TextGadget(#Text_6, 10, 10, 580, 20, "Thanks for installing "+appname+". We And the program authors hope you like the program.")
Frame3DGadget(#Frame3D_4, 10, 140, 580, 50, "")
ButtonGadget(#Gad_But_Fin, 20, 160, 70, 20, "Finish")
EndIf
EndIf
EndProcedure
;*-----------------------------------------------------------------
;-Entry Point
;*-----------------------------------------------------------------
Getinfo()
intro:
Open_win_intro()
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Gad_But_End
End
ElseIf GadgetID = #Gad_But_Next1
CloseWindow(#win_intro)
Break
EndIf
EndIf
Until Event = #PB_EventCloseWindow
yesno:
Open_Win_Agree()
If agree=1
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Gad_But_Back1
CloseWindow(#Win_Agree)
Goto intro
ElseIf GadgetID = #Gad_But_Next2
CloseWindow(#Win_Agree)
Break
ElseIf GadgetID = #Gad_Rad_Do
DisableGadget(#Gad_But_Next2,0)
ElseIf GadgetID = #Gad_Rad_dont
DisableGadget(#Gad_But_Next2,1)
EndIf
EndIf
Until Event = #PB_EventCloseWindow
EndIf
Open_Win_Location()
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Gad_Str_Loc
If Right(GetGadgetText(#Gad_Str_Loc),1)<>"\"
SetGadgetText(#Gad_Str_Loc,GetGadgetText(#Gad_Str_Loc)+"\")
EndIf
If showspace=1
Str.s=GetGadgetText(#Gad_Str_Loc)
get_HD_space(PeekS(@Str,3))
SetGadgetText(#Text_Txt_Space,"Space Available: "+Str(FreeMB)+"MB"+Chr(10)+"Space Required: "+Str(bsize)+"MB"+Chr(10)+"Space After: "+Str(FreeMB-bsize)+"MB")
EndIf
EndIf
If GadgetID = #Gad_But_Back2
CloseWindow(#Win_Location)
If agree=1
Goto yesno
Else
Goto intro
EndIf
ElseIf GadgetID = #Gad_But_Next3
If checkdir(GetGadgetText(#Gad_Str_Loc))=1
installto.s=GetGadgetText(#Gad_Str_Loc)
CloseWindow(#Win_Location)
Break
EndIf
ElseIf GadgetID = #Gad_But_Brw
SetGadgetText(#Gad_Str_Loc,PathRequester("Install to ...",GetGadgetText(#Gad_Str_Loc)))
EndIf
EndIf
Until Event = #PB_EventCloseWindow
Open_Win_Background()
Open_Win_Progress()
install(installto)
CloseWindow(#Win_Progress)
Open_Win_Fin()
Repeat
Event = WaitWindowEvent()
If Event = #PB_EventGadget
GadgetID = EventGadgetID()
If GadgetID = #Gad_But_Fin
If readme=1
If GetGadgetState(#Gad_Chk_Read)=1
RunProgram("NotePad","Readme.txt","")
EndIf
EndIf
End
EndIf
EndIf
Until Event = #PB_EventCloseWindow
End
and some notes before you use it the creator will create a folder in it working directory with the display name
the installer will require the side1.bmp,side2.bmp,side3.bmp,side4.bmp,main.rip (that should be there already), the rip.lst (that also should be there), and if the dynamic backround was NOT selected it will require the back.bmp
i think thats it, have fun
