Jump to content

Installer Template (Updated 2-18-12)


LiquidNitrogen
 Share

Recommended Posts

Quick Installer Template. In Rar Archive is the Side image for the Installer and the Script.

Updates:

(2-10-12)

- Moved Progress Bar From Window to GUI

- Added Title Headers for "Terms and Conditions" and the Installation Step

- Now Displays The Directory of Installation While Installing

- Added Check Boxes at End of Installation for "Run Application" And "Create Desktop Shortcut".

(2-11-12)

- Added Cancel Button to Cancel Installation During the Process of Installation.

(2-18-12)

- Changed Progress Bar to GDIpProgress Bar Thanks to ProgAndy For his UDF.

New (2-18-12): Installer Template.rar

This Update Requires you to Have the GDIpProgress and GDIpProgress_Ex Include Files. You Can Get them From Here:

Edited by ReaperX

Formerly ReaperX

Link to comment
Share on other sites

As it happens, I am actually working on an installer too. Not so much the installation side of it though, but it would definately be worth taking a look at this to see how other people are going about it too. Thanks for sharing this.

I Might Work on this Some More to Improve it on the Installation Side.

Formerly ReaperX

Link to comment
Share on other sites

I Might Work on this Some More to Improve it on the Installation Side.

Thanks. But I don't plan to release it without it being fully functional and customizable. I think that what will happen, is I will write a program to encode the contents of the selected directory (where the installed files will be), present the user with a window to allow for registry settings, and then compile.

Link to comment
Share on other sites

Thanks. But I don't plan to release it without it being fully functional and customizable. I think that what will happen, is I will write a program to encode the contents of the selected directory (where the installed files will be), present the user with a window to allow for registry settings, and then compile.

Sounds Good. :)

Edited by ReaperX

Formerly ReaperX

Link to comment
Share on other sites

  • 2 weeks later...

hi

maybe

$Progress1 = GUICtrlCreateProgress(120, 200, 257, 25,$WS_EX_WINDOWEDGE)
  
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", 0, "wstr", 0)
    GUICtrlSetStyle($Progress1, BitOr($GUI_SS_DEFAULT_PROGRESS, $PBS_SMOOTH))
  
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFFFFFF)

or

$Progress1 = GUICtrlCreateProgress(120, 200, 257, 25)
  DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle($Progress1), "wstr", 0, "wstr", 0)
   
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetBkColor(-1, 0xFFFFFF)
Edited by mesale0077
Link to comment
Share on other sites

Nice Modifications! i tried to cancel once i click on the Install button. but it were not able to stop the progress bar action and it skips! Please have a look!

To Fix this i just modified the _Installfiles() function as below. Please appologize for modified your code without your knowledge!

Func InstallFiles()

AutoItSetOption("GUIOnEventMode", 1)
Global $InstallDir
GUICreate("Installer Template", 400, 340)
GUICtrlCreatePic("image.jpg", 10, 10, 100, 320)
GUICtrlCreateLabel("Installation in Progress", 130, 50, 200)
GUICtrlSetFont(-1, 12)
$Progress = _ProgressCreate(130, 120, 250, 30)
_ProgressSetFont($Progress, "", 0, 2)
_ProgressSetColors($Progress, -1, -1, 0xDCDCDC, 0xDCDCDC)
GUICtrlCreateLabel("Directory:", 130, 160)
GUICtrlCreateInput(GUICtrlRead($InstallDir), 180, 160, 200, 18, BitOR($GUI_SS_DEFAULT_INPUT, $ES_READONLY))
$CancelButton = GUICtrlCreateButton("Cancel", 320, 313, 80)
_ProgressSetText($Progress, "Loading...")

GUISetState()

Sleep(1200)

For $i = 0 To 100 Step 10
If GUICtrlRead($CancelButton) <> "Cancel" Then ;==============> This condition will do the trick

_ProgressSet($Progress, $i)
_ProgressSetText($Progress, "Installing... " & $i & "%")
If $i > 40 Then
_ProgressSetText($Progress, "Cleaning Up... " & $i & "%")
ControlDisable("", "", $CancelButton)
Else
_ProgressSetText($Progress, "Installing... " & $i & "%")
EndIf
If $i = 100 Then _ProgressSetText($Progress, "Installation Complete!")
Sleep(700)
GUICtrlSetOnEvent($CancelButton, "_CancelInstallation")
Else ;============================> else part for the cancelation
_CancelInstallation()
EndIf
Next
Sleep(1000)
AutoItSetOption("GUIOnEventMode", 0)
GUIDelete()
InstallationComplete()


EndFunc   ;==>InstallFiles
Edited by Syed23

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...