How to install an application using large libraries?

Windows specific questions.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

WOW, I haven't report about my testing yet and you finished the second release. Good job!

For the first release the download is working like a charme. Good user information at the screen. Found some smaller issue regarding the predicted size of the installation.

But I will test the second release and report in detail later.

I think it would be helpful if you have a GTk app to test the installer. I made a small FB code that tests if GTK is installed and which version it is. You can compile it and use it as a replacement of your 'MyApp.exe':

Code: Select all

' GtkTest.bas
' by TJF, 2010

#INCLUDE ONCE "gtk/gtk.bi"

#DEFINE NULL 0

DIM AS GtkWidget PTR win
DIM AS GtkWidget PTR frame
DIM AS GtkWidget PTR label
DIM AS INTEGER  v1, v2, v3
DIM AS STRING GtkVersion

' Initialise GTK
IF 0 = gtk_init_check (@__FB_ARGC__, @__FB_ARGV__) THEN
  SCREENRES 300, 70
  ?!"\n\nNo GTK installation found!\n\nPress a key to finish."
  SLEEP
  END -1
ELSE
  v1 =  4 : WHILE gtk_check_version(v1, v2, v3) : v1 -= 1 : WEND
  v2 = 99 : WHILE gtk_check_version(v1, v2, v3) : v2 -= 1 : WEND
  v3 = 44 : WHILE gtk_check_version(v1, v2, v3) : v3 -= 1 : WEND
  GtkVersion = !"\n" & v1 & "." & v2 & "." & v3 & !"\n"
END IF

win = gtk_window_new (GTK_WINDOW_TOPLEVEL)
g_signal_connect(G_OBJECT(win), "destroy", G_CALLBACK(@gtk_main_quit), NULL)
g_signal_connect(GTK_WIDGET(win), "key-press-event", G_CALLBACK(@gtk_main_quit), NULL)

gtk_window_set_title (GTK_WINDOW (win), "GtkTest")
gtk_container_set_border_width (GTK_CONTAINER (win), 70)

frame = gtk_frame_new (" installed version is ")
label = gtk_label_new (SADD(GtkVersion))
gtk_container_add (GTK_CONTAINER (frame), label)
gtk_container_add (GTK_CONTAINER (win), frame)

gtk_widget_show_all (win)

gtk_main ()
If no GTK is installed, a FBgfx-window is opened for user information. Otherwise a GTK window will show the version#.
Last edited by TJF on Oct 07, 2010 14:10, edited 1 time in total.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

AMIBCT wrote:There is one problem with changing description text of sections during runtime
I was unable to find an easy solution for it
I think it's not possible to call UI macros inside the OnInit function. It meight be neccessary to save the values somewhere and call the desired functions after OnInit has finished?
AMIBCT wrote:Currently the GTK+ installation and version number is studied and the relevant item is selected as necessary.
but no message is being shown for the user.
The SectionSetFlags command (rev1) doesn't work on my system (XP SP3). The checkbox GTK installation is allways selected allthough I have a system wide GTK installation working.
AMIBCT wrote: Finally about the installer rewriting previous version of GTK+
There should be no problem while the GTK+ installer is called to create the files in YOUR APPLICATION DIRECTORY and create NO registry values.
This is an issue on my list of things I would like. If a GTK installation is neccessary, the user should have two options
  • A) global (system wide) installation of GTK
    B) local installation inside the app folder
I think we shouldn't implement this before the version check works properly.

Other issues:

1)
When the checkbox GTK installation is checked, there is no update of the space required label. It should be possible to add a (predefined) value to the required space (12.6 MB actually).

2)
Uninstall does not remove
  • the entry in the windows shortcut menu
    the folder Redist, including the GTK installer .exe file
From my point of view the Redist folder can be removed during installation process (after the installer did run succesfully). But the entries in the windows menu are neccessary and should be removed properly. (On my system they are write protected?!)
AMIBCT wrote:Any advice on how improvements can be done, is welcome.
Be sure: I'll do my very best :) Thank you for your effort so far.
AMIBCT
Posts: 53
Joined: Jan 14, 2008 8:48
Location: Tehran
Contact:

Post by AMIBCT »

Bug fixes:

- GTK Section Size Added.
- Test app replaced with GTK sample.
- Start Menu folder deletion now should be correct.
- GTK+ installer now is deleted after installation.
- GTK+ download link updated to the latest version ( 2.22 ).
- GTK+ Uninstallation is now complete.

http://www.4shared.com/file/weYriBxS/In ... _rev2.html
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

AMIBCT wrote:Bug fixes: ...
- GTK Section Size Added. -> WLAC (rev2)
- Test app replaced with GTK sample. -> WLAC (rev2)
- Start Menu folder deletion now should be correct. -> WLAC (rev2)
- GTK+ installer now is deleted after installation. -> WLAC (rev2)
- GTK+ download link updated to the latest version ( 2.22 ). -> WLAC (rev2)
- GTK+ Uninstallation is now complete. Now there are two folders left in the instdir (\share\local)?

Since we have version 2.22 now, we have to add 14.4 Mb to the section size :). Unfortunately the version check does not work yet. At my system the checkbox for GTK installation is allways checked - no matter if a GTK is in the PATH or not. (Does anybody get different results on other systems?)

(WLAC = works like a charme)
AMIBCT
Posts: 53
Joined: Jan 14, 2008 8:48
Location: Tehran
Contact:

Post by AMIBCT »

Thanks for test

-The share/local folder problem is just a typing error( locale instead of local )
-Size of installed files updated

And about version check: I don't know why doesn't it work on your system.

Some messageboxes may show if the dll file and reg key are accessible.

Like this:
MessageBox MB_OK <The Variable Such As $0 at line 178 or $R0 at line 163>
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

AMIBCT wrote:And about version check: I don't know why doesn't it work on your system.

Some messageboxes may show if the dll file and reg key are accessible.

Like this:
MessageBox MB_OK <The Variable Such As $0 at line 178 or $R0 at line 163>
Where to place MessageBox? It has to be inside a function. I'd like to see the info after
  • .onInit
and before
  • !insertmacro MUI_PAGE_COMPONENTS
BTW:
I can make an installer using the .nsi file. You need not prepare a complite zip file for download.
AMIBCT
Posts: 53
Joined: Jan 14, 2008 8:48
Location: Tehran
Contact:

Post by AMIBCT »

Just put the messagebox on the line after

StrCpy $0 "$R2.$R3.$R4.$R5" ( Line 178 )

Sth like this

MesageBox MB_OK $0

It will show you if it has reached there and if the file was detected and what version has it.

--
about that macro

Tracing it won't help you to solve any problem
That macro is not run in runtime but in compile time and saves some vars, etc.

I'll search more to find a way changing description at runtime
--
Edit
The section description problem solved
( by Help of Andres at Winamp Forums - Thanks to him )
--

If there was someone else to test it out
It would be easier to solve the problem

COME ON PEOPLE ! ;)
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

AMIBCT wrote:Just put the messagebox on the line after

StrCpy $0 "$R2.$R3.$R4.$R5" ( Line 178 )

Sth like this

MesageBox MB_OK $0

It will show you if it has reached there and if the file was detected and what version has it.
No MessageBox on the screen. What I'm doing wrong? I used this .onInit:
Function .onInit

SectionSetSize ${Sec3} 14400

!ifdef FullInstaller
SetShellVarContext all

ReadRegStr $R0 HKLM "SOFTWARE\GTK\2.0" "DllPath"
StrCmp $R0 "" no_gtk have_gtk

no_gtk:
SectionSetFlags ${Sec3} ${SF_SELECTED}
;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
;!insertmacro MUI_DESCRIPTION_TEXT ${Sec3} "found no GTK+ installation, need to download and install GTK+ version ${GTK_VER}"
;!insertmacro MUI_FUNCTION_DESCRIPTION_END
Goto Exit

have_gtk:
GetDllVersion "libgtk-win32-2.0-0.dll" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
StrCpy $0 "$R2.$R3.$R4.$R5"

MessageBox MB_OK $0

IntCmp $R2 ${GTK_LEAST_MAJOR_VERSION_NEEDED} 0 Old 0
IntCmp $R3 ${GTK_LEAST_MINOR_VERSION_NEEDED} VerOK Old VerOK

Old:
SectionSetFlags ${Sec3} ${SF_SELECTED}
;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
;!insertmacro MUI_DESCRIPTION_TEXT ${Sec3} "Found old GTK+ installation version $0, need to download and install version ${GTK_VER}"
;!insertmacro MUI_FUNCTION_DESCRIPTION_END

VerOk:
Exit:
SetShellVarContext current
!endif
FunctionEnd
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

Found the error: we cannot depend on the code
ReadRegStr $R0 HKLM "SOFTWARE\GTK\2.0" "DllPath"
StrCmp $R0 "" no_gtk have_gtk
to find out if GTK+ is installed or not. In my case I installed using a zip file and I didn't do any RegStr things. So the installer didn't find an entry and goes to Exit: (the MessageBox MB_OK $0 was skipped).

I think it's best to remove this code and test only the version str ("$R2.$R3.$R4.$R5"). If no GTK+ is installed, we should get the version str "0.0.0.0". So we just need to compare the version str and the desired version. If the desired version is greater than the version str (or the values in $R2, $R3, $R4, $R5), we have to download and install GTK+.

@AMIBCT:
What do you think about that?
AMIBCT
Posts: 53
Joined: Jan 14, 2008 8:48
Location: Tehran
Contact:

Post by AMIBCT »

Excellent

ChangeLog:
- License agreement
- Script cleanup
- More generalization
- Installer title fixed
- Section and SectionGroup names fixed
- GTK detection fixed
- GTK Section description now reflects detection result
- Delete GTK extra files after uninstall
- Fixed future versions of GTK detection bug ( 3.0+ )

http://www.4shared.com/file/p3YfZVd3/In ... _rev3.html
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

Works brilliant, so far.

From my point of view the next step is: we have a weak point in our concept! If there is no GTK installed and the user unchecks the download and install box, he'll get a non working installation. So if no GTK is aviable, the download and install box must be checked allways (like the Main Programs box). Can this be done during runtime?

And I like to give the user a choise to
  • either install GTK+ global
    or install GTK+ local in the InstDir (only for our MyApp.exe, like it is done actually).
I don't know how to realise it in the components page. (We may think about an additional page before.)
AMIBCT
Posts: 53
Joined: Jan 14, 2008 8:48
Location: Tehran
Contact:

Post by AMIBCT »

I myself don't like to force user do sth because I don't like to be forced !

If GTK is not available, the checkbox is selected and user is informed to install GTK
but if he/she doesn't like to download GTK, we mustn't force him/her.
Anyway it's easily possible to force user.

About installation type( Global, Local )
It's a good idea. I'll try to add this feature, maybe an option page after components page would be better than before it.

Have a nice day
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

AMIBCT wrote:I myself don't like to force user do sth because I don't like to be forced !
This is a good statement - I agree 100 % !

In this case I think we don't force the user to do anything. He'll be informed about the software requirements and about the next steps to do. He may abort the installer if he doesn't like what the installer needs to do. But if he continues, he should get a working installation. (Does it makes sense to install MyApp.exe without the required DLLs?)
AMIBCT wrote:If GTK is not available, the checkbox is selected and user is informed to install GTK
but if he/she doesn't like to download GTK, we mustn't force him/her.
Anyway it's easily possible to force user.
From my point of view, we are forced to fulfill software requirements and our installer can (and should) pass this necessities to the user. I think it's better to avoid unsuccessful installation rather than being gently to the user. (If the installation isn't successful, some users won't be gently to us and we loose a lot of time doing trouble shooting.)
AMIBCT wrote:About installation type( Global, Local )
It's a good idea. I'll try to add this feature, maybe an option page after components page would be better than before it.
On an extra page we can place additional information about GTK+ (some users may not know anything about it).

We also may think about two entries in the Runtime files section. And the user may choose either the first or the second (like radio buttons).

But I'm not keen on neither making nor using windows installers. You are the expert: option page or radio buttons - make your mind.

Additional statements from other forum members are wellcome!
AMIBCT wrote:Have a nice day
Thanks, you too. And good luck for the next steps!
AMIBCT
Posts: 53
Joined: Jan 14, 2008 8:48
Location: Tehran
Contact:

Post by AMIBCT »

Excuse me for long delay
I was too busy and unable to work on it.

Changelog:
- New GTK+ Installation type selection page( Not tested )
- GTK+ Section is now Read-Only if GTK+ not installed
- Finished !

Creating a custom page took me about 2 hours
It was first time for me to design a page with nsDialogs

But it's nice and I like it ! ;)

Download - 167 KB
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

AMIBCT wrote:Excuse me for long delay
Anyway, you're faster than me. Thanks for rev4.

I downloaded it, but today I'm too busy for testing. I'll report tomorrow.
Post Reply