Bug 315040 - "there are kde applications running" message on updating
Summary: "there are kde applications running" message on updating
Status: RESOLVED REMIND
Alias: None
Product: kde-windows
Classification: Miscellaneous
Component: installer (show other bugs)
Version: 4.8
Platform: Microsoft Windows Microsoft Windows
: NOR major
Target Milestone: ---
Assignee: KDE-Windows
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-13 07:58 UTC by Mihai Sorin Dobrescu
Modified: 2013-08-10 17:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Sorin Dobrescu 2013-02-13 07:58:46 UTC
I have installed KDE on Windows 7 Enterprise 64bit, msvc build, and I try to update it.
There are no KDE processes except the KDE installer itself, but the "there are kde applications running" message appears and KDE can't be updated.



Reproducible: Always

Steps to Reproduce:
Follow the update procedure: 
1. Start the installer only (nu other KDE apps running)
2. Let it detect the updates
3. Start update
4. A dialog box appears saying: "there are kde applications running"
5. The installation stops as the installer closes.
Actual Results:  
The upgrading fails.

Expected Results:  
The KDE processes should be identified correctly and the installation (upgrading) should continue.

The issue is in the code:

bool InstallerEngine::isAnyKDEProcessRunning()
{
QString cmd = m_root +""/bin/kdeinit4.exe"";
QProcess p;
QStringList args = QStringList() << ""--list"";
p.start(cmd,args);
if (!p.waitForStarted())
{
qCritical() << ""could not start"" << cmd << args;
return false;
}
if (!p.waitForFinished())
{
qCritical() << ""failed to run"" << cmd << args;
return false;
}
QByteArray _stderr = p.readAllStandardError();
qDebug() << ""run"" << cmd << args << ""without errors"" << _stderr;
QList<QByteArray> lines = _stderr.split('\n');
int ret = lines.size() - 1; // because of trailing '\n'
// one line means ony kdeinit4 is running
return ret > 1;
}

M:\KDE\bin>kdeinit4 --list
path: M:/KDE/SETUP name: kdewin-installer-gui-latest pid: 3936
path: M:/KDE/bin name: kdeinit4 pid: 7732

M:\KDE\bin>

So, there is an additional line, because kdeinit4 reports itself, the installer process is also there and the \n too.
Comment 1 Ralf Habacker 2013-08-10 17:02:08 UTC
With commit http://commits.kde.org/kdewin-installer/a737033ea1038ed154c95e5416c8d91b224a5cd7 the installer has been excluded from the list of kde application in use, but im not sure if this really solve the problem. 

Normally the installer will be copied to a temporary location before running
main.cpp
    //
    // when installer is located in install root dir run it from a temporary location 
    // to avoid installer executable acess problem for update and removal,
    //
    if (SelfInstaller::instance().isRunningFromInstallRoot())
    {
        QStringList args = QApplication::arguments(); 
        args.removeFirst();
        SelfInstaller::instance().runFromTemporayLocation(args);
    }
  and your report 

path: M:/KDE/SETUP name: kdewin-installer-gui-latest pid: 3936

indicates that this did not happens. 

There must be a problem with this detection in isRunningFromInstallRoot()