Bug 256372 - Add a DigiKam installer based on nsis
Summary: Add a DigiKam installer based on nsis
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Bundle-Windows (show other bugs)
Version: 1.7.0
Platform: Microsoft Windows Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-08 15:30 UTC by Julien Narboux
Modified: 2017-01-21 11:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 1.8.0


Attachments
nsis script file a first try not tested (3.71 KB, text/script)
2010-11-08 15:31 UTC, Julien Narboux
Details
icon needed for the windows installer (25.21 KB, image/bmp)
2010-11-08 15:32 UTC, Julien Narboux
Details
another icon needed by the installer (150.92 KB, image/bmp)
2010-11-08 15:32 UTC, Julien Narboux
Details
new version of the nsis script (5.02 KB, text/plain)
2010-11-08 23:11 UTC, Julien Narboux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Narboux 2010-11-08 15:30:01 UTC
Version:           unspecified
OS:                MS Windows

Here is an example of an nsis script which could be used as a start for building a windows installer for DigiKam.

Reproducible: Didn't try
Comment 1 Julien Narboux 2010-11-08 15:31:32 UTC
Created attachment 53246 [details]
nsis script file a first try not tested
Comment 2 Julien Narboux 2010-11-08 15:32:19 UTC
Created attachment 53247 [details]
icon needed for the windows installer
Comment 3 Julien Narboux 2010-11-08 15:32:50 UTC
Created attachment 53248 [details]
another icon needed by the installer
Comment 4 Julien Narboux 2010-11-08 23:11:52 UTC
Created attachment 53259 [details]
new version of the nsis script

This version install Digikam in the right directory, add items in start menu, and register uninstaller in windows.
Running Digikam does not work, this should be an ioslave problem.
Gilles, is your 7zip .exe distribution of DigiKam supposed to work in a fixed directory ?

To compile this script, you need to have in the directory:
- the digikam.nsi file,
- the two icons files,
- the COPYING file from digikam sources and 
- the kde4 directory from Gille's 7zip:
http://digikam3rdparty.free.fr/misc.tarballs/digikam1.6.0-kde4.4.exe




Julien
Comment 5 caulier.gilles 2010-11-09 09:21:43 UTC
my archive can be installed where you want. It work as well.

I tested this archive on a fresh WinXP computer, without any KDE4 installation, and it's work. I uncompress the archive into D:/KDE4 (D:/ is an empty partition)

Gilles Caulier
Comment 6 caulier.gilles 2010-11-09 11:32:49 UTC
SVN commit 1194542 by cgilles:

add nsis windows script to package windows installation
CCBUGS: 256372


 A             nsis (directory)  
 A             nsis/COPYING  
 A             nsis/digikam.nsi  
 AM            nsis/digikam_header.bmp  
 AM            nsis/digikam_welcome.bmp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1194542
Comment 7 caulier.gilles 2010-11-10 10:49:11 UTC
Julien, 

I can reproduce the problem of kioslave which are not started when digiKam is launched.

I suspect a problem to registery KDE4 install path /bin in windows PATH. Look like KDE windows installer do it automatically (at end of installation, KDE windows installer said "updating windows registery")
 
We need to know :

- what's KDE windows installer do exactly in windows registery.
- How to reproduce it with NSIS installer.

Patrick, can you point us at the right place for this windows registery problem ? Thanks in advance

Gilles Caulier
Comment 8 caulier.gilles 2010-11-10 11:02:30 UTC
SVN commit 1195064 by cgilles:

adapt LZMA compressin settings to perform a better ratio, as 7Zip Utra mode. 
Archive size is now 230Mb instead 320Mb. More than 100Mb !
CCBUGS: 256372


 M  +10 -3     digikam.nsi  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1195064
Comment 9 Julien Narboux 2010-11-10 11:18:43 UTC
Gilles,

I did not install DigiKam with kdewin installer but only using your 7zip archive.
I noticed that when you launch DigiKam installed by the 7zip archive, ms windows ask if it can run two kde utilities. These tools creates a start menu entry "Kde 4.4.4".
I don't know why it does not run these utilities when installed using nsis.
Does the 7zip archive contains a script ?
I also noticed that the start menu item for Digikam in Kde 4.4.4 installed by 7zip starts DigiKam inside the kde4/bin directory, this may be the reason it can find other binaries in the current directory...

Julien
Comment 10 Patrick Spendrin 2010-11-10 11:26:57 UTC
Hm, neither registry nor PATH should be the problem.
In the registry only settings for the installer itself are stored, e.g. its
last install path etc. (We tried to keep KDE on Windows away from that).
The PATH shouldn't normally be the problem as we tried to avoid conflicts there
too.
This must be tried out though.
So start a cmd.exe, enter 'set
PATH=C:\Path\to\Digikam\Installation\bin;C:\Path\to\Digikam\Installation\lib;%PATH%'
(without the ') and if that works, then you really have a PATH problem. Please
check that you don't have any dlls under lib folder, except plugins under
lib\kde4.

One more thing I just read now: you cannot move digikam out of the bin folder!
This is hardcoded and assumed everywhere...
Comment 11 caulier.gilles 2010-11-29 15:31:31 UTC
Julien,

7ZIP archive of my KDE 4.4.4 install dir including current code from svn trunk of digiKam, Kipi-plugins and kdegraphics/libs is available :

http://digikam3rdparty.free.fr/misc.tarballs/digikam-install.exe

Please, try to run nsis from your computer to package it as installer.

Also, look if after to install this new nsis package, you only find one subfolder on destination dir (typically "kde4"). if not this can be the source of the problem with NSIS packaging. On my computer, i can find 2 other subfolder which must not created here.

Gilles Caulier
Comment 12 caulier.gilles 2010-11-29 15:32:08 UTC
Patrick,

Thanks for you tips. i will take a look...

Gilles Caulier
Comment 13 Julien Narboux 2010-12-01 22:35:42 UTC
Gilles,

I created this installer, and now it seems to work... I don't know why.

If someone can test on different versions of windows it would be nice:

http://dpt-info.u-strasbg.fr/~narboux/digiKam-installer-1.7svn.exe

In the future, it would be nice to sign the applications to prevent windows from asking always the permission to execute the programs.

Julien
Comment 14 caulier.gilles 2010-12-01 22:42:27 UTC
Julien,

When you install this self installer, do you see only the same contents created in target place that the 7zip archive contents ?

Gilles Caulier
Comment 15 Julien Narboux 2010-12-02 08:01:56 UTC
Gilles,

Yes I see the same content: the whole kde4 directory. I noticed there is a bug in the uninstaller, it does not delete the files and some shortcuts. I will fix that.

I also noticed while deleting by hand some test installations, that windows complains that some programs are running, maybe the kioslave problem is related to that: if you install one version of digikam, then run it, then install another version in a different directory then the kioslave in memory is the wrong one ?
We need to investigate more.

Julien
Comment 16 caulier.gilles 2010-12-03 15:56:50 UTC
SVN commit 1203299 by cgilles:

Know bugs under windows.
Julien, can you add a new page in installer to display this contents.
Of course, feel free to add new entries in this file.


 A             KNOWBUGS
Comment 17 caulier.gilles 2010-12-03 16:12:32 UTC
Julien, 

new zip archive including KDE4 system setings:

http://digikam3rdparty.free.fr/misc.tarballs/digikam1.7.0-svn.exe

Next week, i plan to make new 7zip archive with digikam compiled without debug symbols, to optimize space on disk.

Gilles Caulier
Comment 18 caulier.gilles 2010-12-05 16:58:20 UTC
Julien,

I updated my 7Zip archive at usual place :

http://digikam3rdparty.free.fr/misc.tarballs/digikam1.7.0-svn.exe

Last code from svn trunk is now used. All is compiled using "relwithdebinfo" option (Release with Debug Information) intead "debugfull" :

http://techbase.kde.org/Development/Tutorials/CMake#Command_Line_Variables

Other stuff : with digiKam 1.7.0 will be released, we must upload this nsis installer to sourceforge.net repository. Julien, do you have an account to sf.net ? 

Gilles Caulier
Comment 19 Julien Narboux 2010-12-05 18:48:19 UTC
Gilles, 

I don't have an account on sf, do you want me to ask for an account ?
We also need to simplify the download page on DigiKam's website, I have an account I will do it when I have free time.


Julien
Comment 20 caulier.gilles 2010-12-05 23:18:18 UTC
>I don't have an account on sf, do you want me to ask for an account ?

Yes, sure...

Gilles
Comment 21 caulier.gilles 2010-12-06 08:59:27 UTC
Julien, 

I renamed KNOWNBUGS file to RELEASENOTES. It will be better to display this file insead to embed contents as will on nsi project file.

Look here to know how to do it :

http://nsis.sourceforge.net/Docs/Modern%20UI/Readme.html

... into "Custom pages" section. There is a macro to display a text file :

!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioFile.ini"

Gilles
Comment 22 Julien Narboux 2010-12-08 22:42:15 UTC
Gilles and all,

A new version of the installer based on latest 7zip by Gilles is  available here:
http://dpt-info.u-strasbg.fr/~narboux/digiKam-installer-1.7svn.exe

Julien
Comment 23 caulier.gilles 2010-12-09 13:27:54 UTC
Julien, 

The installer work perfectly. digiKam run perfectly too.

Just one point : if some previous KDE4 process have been used previously (as dbus service), the installer will crying that it cannot install some shared dll from the archive.

In this case, you must kill KDE4 process before to run installer.

I know that KDE windows installer post a message to user in this case.

Another point is to optimize again archive size. 
Before official 1.7.0, i plan to remove KDE-edu package (including marble widget) from my KDE4 install, and recompile/install myself marble for digiKam. This will limit the kdeedu bin files installed which are not used by digiKam of course.

Also, when 1.7.0 release will be done, will will create archive including translations files.

Gilles Caulier
Comment 24 Laurent Espitallier 2010-12-10 00:52:26 UTC
Excellent setup.

Maybe with :

Setcompressor /SOLID lzma

you could get an even smaller installer :

http://nsis.sourceforge.net/Docs/Chapter4.html

"If /SOLID is used, all of the installer data is compressed in one block. This results in greater compression ratios."

about "dbus-daemon" i'd manage it like this (not tried) :

!include LogicLib.nsh

LangString DESC_KillDbus ${LANG_ENGLISH} 'You need to close "Dbus-daemon" to install ${MY_PRODUCT} properly. Would you like this setup to do it now ?'
LangString DESC_KillDbus ${LANG_FRENCH} 'Vous devez quitter "Dbus-daemon" pour installer correctement ${MY_PRODUCT}. Voulez vous que ce programme d'installation s'en charge maintenant ?'
 
Processes::FindProcess "dbus-dameon"
Pop $R0

${If} $R0 > 0
  MessageBox MB_YES "${DESC_KillDbus}" IDNO abort_setup
  Processes::KillProcess "process_name"
  Goto skip_kill

  abort_setup:
  Abort

${Else}

${EndIf}

NSIS Processes plugin : http://nsis.sourceforge.net/Processes_plug-in
Comment 25 Julien Narboux 2010-12-10 08:07:25 UTC
Laurent, 

Thank you for the code to manage process !
For the compression we already use SOLID.

Gilles,

Another point: what about deleting the components page ? as we have only one component: digiKam this page is useless, and it would simlify i18n not to have langage strings. 

Julien
Comment 26 caulier.gilles 2010-12-10 09:47:20 UTC
Julien, 

Yes, i agree to remove component page.

Gilles
Comment 27 Julien Narboux 2010-12-10 14:10:39 UTC
Laurent, Gilles, Patrick, 

I don't understand the problem about a running daemon while installing, we are just copying files in a directory. Do you mean that there is a problem if we try to overwrite a daemon which is already running ?

Which daemons do we need to kill ? I think we need a complete list:
mime_update_database ? kio ? dbus_deamon ? kded ? klauncher ? knotify ? other ?

Julien
Comment 28 Laurent Espitallier 2010-12-10 15:17:02 UTC
I think running processes will be a problem for future releases if digikam has been run once in a windows user session and the user want to update digikam.

(if you plan to install new releases in the same folder)
Comment 29 caulier.gilles 2010-12-10 19:26:40 UTC
if dbus run due to an old kde application instance, dbus will open shared libs. Overwritting this libs will not be permit by windows and installer will crying.

dbus is not open by installer.

Gilles Caulier
Comment 30 Julien Narboux 2010-12-10 22:34:44 UTC
Hi,

I tested a new version of the installer which kills some process. It works! I can install digikam at the same place as a running digiKam.
But we need to test this a lot, I read that some antivirus may detect the installer as a malware because of the use of the nsis plugin to kill process.

Maybe we could also put digikam by default in a directory name which contains version number such as digikam-1.7 for instance.

TODO: check for errors and send message to user.

Julien
Comment 31 caulier.gilles 2010-12-15 14:07:16 UTC
Julien, 

new zip archive update. Size have been improved (255 Mb instead 275Mb):

http://digikam3rdparty.free.fr/misc.tarballs/digikam1.7.0-svn.exe

With this version all kde-edu package have been droped. I compiled and installed marble widget only for digiKam.

Gilles Caulier
Comment 32 ruedbi 2010-12-18 18:32:24 UTC
Tried the version linked in #31 under Windows 7; for me the batch processor produces only pure black images, independent of the tools used.
Comment 33 caulier.gilles 2010-12-23 15:44:50 UTC
Julien,

I compiled and installed digiKam and kipi-plugins 1.7.0 with KDE 4.4.4 on my Win7.

7Zip tarballs is available here :

http://digikam3rdparty.free.fr/misc.tarballs/digiKam1.7.0.exe

Please, make a new version of NSIS installer and upload it to SF.net repository.

After that, this file can be closed...

Thanks in advance

Gilles Caulier
Comment 34 Julien Narboux 2010-12-23 22:43:45 UTC
upload in progress