Add custom KEXI nsis installer
Needs ReviewPublic

Authored by staniek on Mar 13 2019, 9:51 PM.

Details

Reviewers
vonreth

Diff Detail

Repository
R877 Craft Blueprints for KDE
Branch
kexi-installer-staniek
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 10344
Build 10362: arc lint + arc unit
staniek requested review of this revision.Mar 13 2019, 9:51 PM
staniek created this revision.

first wave

extragear/kexi/kexi/NullsoftInstaller.nsi
148

we don't ship the redist installer anymore but the dlls directly.

152

Not needed anymore see base script

164

kdeinit5 is broken, better use the nsis extension, for killing the processes ,used in the base script

extragear/kexi/kexi/blacklist.txt
19

are you sure you don't need libGLES?

21

what about hunspell?

extragear/kexi/kexi/kexi.py
35

can you provide a more speaking option name :D

90

Is there a need for this special versioning? We had problems with this before, I'd recommend to just rename the file before distributing it.
On builds from git we put the git revision in the file name anyhow.

107

just use displayname in subinfo

109

just set self.webpage in subinfo

110

don't define executable but use shortcuts directly

extragear/kexi/kexi/whitelist.txt
4

why do you want to ship quassel :D

50

first you blacklist it and then you whitelsit it?

staniek marked 9 inline comments as done.Mar 14 2019, 7:10 PM
staniek added inline comments.
extragear/kexi/kexi/NullsoftInstaller.nsi
152

In PostInstallRoutines.py?

165

@vonreth Does the killing dbus-daemon make sense?

extragear/kexi/kexi/kexi.py
35

"buildForDesktop" ?

110

Trying this:

self.defines["assoc_executable"] = f"bin/kexi-{self.subinfo.buildTarget}.exe"
self.defines["assoc_extension"] = ".kexi"
self.defines["assoc_description"] = "KEXI project file"
self.defines["shortcuts"] = [
    {"name" : f"{self.defines['productname']} {self.defines['version']}",
     "target" : self.defines["assoc_executable"],
     "description" : self.subinfo.description}
]
staniek updated this revision to Diff 53921.EditedMar 14 2019, 8:32 PM
staniek marked 2 inline comments as done.

Updated files, now the installer builds and works. "Run KEXI" from installer does not work and start menu location is not as I expected.

NSIS also shows:

2 warnings:

6000: unknown variable/constant "{assoc_extension}" detected, ignoring (macro:UnRegisterExtensionCall:3)
6000: unknown variable/constant "{assoc_description}" detected, ignoring (macro:UnRegisterExtensionCall:4)

Details:

  • KEXI installer - vcredist: we don't ship the installer anymore but the dlls directly
  • KEXI: Improve blacklist and whitelist
  • KEXI: make custom nullsoftinstaller.nsi closer to the Craft's official, port kexi.py to it
staniek edited the summary of this revision. (Show Details)
vonreth added inline comments.Mar 17 2019, 7:01 PM
extragear/kexi/kexi/NullsoftInstaller.nsi
85

We removed that from the default script as the process gets executed in admin scope, not user scope.

152

As far as I know kde just got clever enough to not need it after a relocation (installer)

165

The process script should kill everything running from the program folder, so dbus should be dead by now

204

This is the reason for

2 warnings:
  6000: unknown variable/constant "{assoc_extension}" detected, ignoring (macro:UnRegisterExtensionCall:3)
  6000: unknown variable/constant "{assoc_description}" detected, ignoring (macro:UnRegisterExtensionCall:4)

You need to use the craft style nsis vars @{foo}

extragear/kexi/kexi/kexi.py
152

No need to copy those files, should be handled by nsis_include_internal
and nsis_include

155

Can you copy them in the preArchive stepp?

def preArchive(self):
    for file in ["COPYING.DOC", "COPYING.LIB", "COPYING", "AUTHORS", "README.md", "README.PACKAGERS.md"]:
        utils.copyFile(os.path.join(self.sourceDir(), file),
                       os.path.join(self.installDir(), file), False)
    return True`
staniek updated this revision to Diff 54806.EditedMon, Mar 25, 8:19 PM
staniek marked an inline comment as done.
  • KEXI: ignore hunspell and qtlocation/sensors/qqcontrols2
  • Simplify blacklist for KEXI, ignore more files
  • NSIS Installer for KEXI: Improve start menu and install dir removal (remove parent KEXI folder if makse sense), fix folder names
staniek added inline comments.Mon, Mar 25, 8:20 PM
extragear/kexi/kexi/NullsoftInstaller.nsi
85

I see. How about using https://nsis.sourceforge.io/ShellExecAsUser_plug-in ?

For I am using:

Function LaunchLink

ExecShell "" "${startmenu}\@{productname} @{version}.lnk"

FunctionEnd

staniek marked 8 inline comments as done.EditedMon, Mar 25, 8:23 PM

@vonreth Everything works as I expected now... I know, the fashion can be improved.

  • KEXI: ignore hunspell and qtlocation/sensors/qqcontrols2
  • Simplify blacklist for KEXI, ignore more files
  • NSIS Installer for KEXI: Improve start menu and install dir removal (remove parent KEXI folder if makse sense), fix folder names

You are shipping sonnet but no dictionaries?

extragear/kexi/kexi/NullsoftInstaller.nsi
85

I had some bad experience with nsis plugins, most are ages old and unmaintained.
How does the ExecShell .lnk solve the issue?

You are shipping sonnet but no dictionaries?

Just checked after temp removal of sonnet: unfortunately modularity still does not go as far as we want. Sonnet is a hard runtime dependency somewhere, maybe in Kate part, but we do not use such feature at the moment. So yes, shipping sonnet but no dictionaries.

extragear/kexi/kexi/NullsoftInstaller.nsi
85

How does the ExecShell .lnk solve the issue?

It does not, I do confirm KEXI is then started as admin, which is indeed not what we want.

I plan to test the ShellExecAsUser function which can solve it. I do not think that WinAPI or plugin will dissappear, it's pretty popular feature I see used in installers.

staniek updated this revision to Diff 54852.Tue, Mar 26, 12:12 PM
  • KEXI: Update package names, ignore also: kemoticons, kdesignerplugin, hunspell-dictionaries
staniek updated this revision to Diff 54875.Tue, Mar 26, 6:05 PM
  • KEXI: move files copying to preArchive()
staniek marked an inline comment as done.Tue, Mar 26, 6:06 PM
staniek updated this revision to Diff 54878.Tue, Mar 26, 6:32 PM
  • KEXI: Use "explorer <link>" to Run KEXI per user request, under explorer's user
staniek added inline comments.Tue, Mar 26, 6:34 PM
extragear/kexi/kexi/NullsoftInstaller.nsi
85

Found different approach without plugins: http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html

It works for me.

See MUI_FINISHPAGE_RUN above.

staniek updated this revision to Diff 55226.Mon, Apr 1, 7:36 PM
  • KEXI: qtlocation and qtsensors are needed by Qt5WebKit, do not disable
vonreth added inline comments.Tue, Apr 2, 9:38 AM
extragear/kexi/kexi/NullsoftInstaller.nsi
25

What is ^Name

133

I'm getting goose bumps
you could just use a @{} define for the containing folder?

vonreth added inline comments.Tue, Apr 2, 9:42 AM
extragear/kexi/kexi/NullsoftInstaller.nsi
85

Hm your not looping it through explorer.exe?
Its kind of ugly but if it works...

You might also wan't to use the sysnative path (https://github.com/KDE/craft/blob/master/bin/Packager/Nsis/process.nsh#L24)
so that it calls the x64 explorer, no idea what strange effects we get with the 32bit one...

(just had the issue with cmd)

staniek added inline comments.Tue, Apr 2, 9:48 AM
extragear/kexi/kexi/NullsoftInstaller.nsi
25

It's notation of the special variable Name defined in line

Name "productname version"

133

It's from https://nsis.sourceforge.io/Get_parent_directory and I think I've been using it several times across the years.

Is there a docs on how to obtain parent folder in NSIS? Because the NSIS grammar still does not support advanced expressions it seems?

staniek added inline comments.Tue, Apr 2, 10:03 AM
extragear/kexi/kexi/NullsoftInstaller.nsi
85

Don't understand "not looping" :) It's passed to explorer via UI_FINISHPAGE_RUN. Tested on win7 64bit. Using what other projects confirm that works, as usual - even if it's undocumented MS would not remove the behavior so easily since people depend on that in many places I bet.

BTW is it possible to get KDE certificate for the installer?

I've found only this older thread: https://www.mail-archive.com/kde-community@kde.org/msg03833.html

BTW is it possible to get KDE certificate for the installer?

I've found only this older thread: https://www.mail-archive.com/kde-community@kde.org/msg03833.html

Code signing is only available through binary factory, there is an exception for Krita but thats not a process we can apply in general. (@bcooksley do you you agree?)

Krita is a highly special case yes. Even in their case we're still running the whole process on the Binary Factory - they don't have the certificate, nor do they have the ability to get arbitrary files signed.

The custom installer you have here would need to be generated and built on the Binary Factory as part of standard Craft runs to be signed.

Well I am not pushing for the cert, in fact it's hard to say how it would be seen by users: is KEXI widely certified and tested by KDE? No, no KDE app is, it's local work.
Maybe I'll have commercial certification or/and the app in app stores. Too early to say.
Thanks.

Well I am not pushing for the cert, in fact it's hard to say how it would be seen by users: is KEXI widely certified and tested by KDE? No, no KDE app is, it's local work.
Maybe I'll have commercial certification or/and the app in app stores. Too early to say.
Thanks.

Signing isn't a metric of code quality, it's more an assurance it hasn't been tampered with.