Better servicemenu(de)installation

This commit is contained in:
Jonathan Schmidt-Dominé 2011-03-02 19:39:45 +01:00
parent 7df8488125
commit 860011c4c5
2 changed files with 25 additions and 11 deletions

View file

@ -12,11 +12,18 @@ dir = archive + "-dir"
# try: installKDE4
# try: install.sh
# try: install
dd = Dir.new(dir)
dd.read
dd.read
dir += "/" + dd.read
dd = nil
while true
dd = Dir.new(dir)
break if dd.count != 3
odir = dir
for entry in dd
dir += "/" + entry if entry != "." && entry != ".."
end
if !File.directory? dir
dir = odir
break
end
end
Dir.chdir(dir)
def fail()
system("kdialog --passivepopup \"Deinstallation failed\" 15")

View file

@ -65,11 +65,18 @@ exit(-1) if !uncompress(archive, dir)
# try: installKDE4
# try: install.sh
# try: install
dd = Dir.new(dir)
dd.read
dd.read
dir += "/" + dd.read
dd = nil
while true
dd = Dir.new(dir)
break if dd.count != 3
odir = dir
for entry in dd
dir += "/" + entry if entry != "." && entry != ".."
end
if !File.directory? dir
dir = odir
break
end
end
Dir.chdir(dir)
def fail()
system("kdialog --passivepopup \"Installation failed\" 15")
@ -79,4 +86,4 @@ if !((File.exist?(file = "./install-it.sh") || File.exist?(file = "./install-it"
fail() if !File.exist?(file = "./installKDE4.sh") && !File.exist?(file = "./installKDE4") && !File.exist?(file = "./install.sh") && !File.exist?(file = "./install")
File.new(file).chmod(0700)
fail() if !system(file + " --local") && !system(file + "--local-install") && !system(file + " --install")
end
end