Commit e5887644 by Csók Tamás

Working setup and uninstall.exe

parent 72b0e56f
[Desktop Entry]
Encoding=UTF-8
Version=0.2
Type=Application
Name=Cloud GUI
Comment=Tool to use CIRCLE Cloud
Exec=cloud2 %u
Icon=/usr/share/icons/cloud.svg
Terminal=true
MimeType=x-scheme-handler/rdp;x-scheme-handler/nx;x-scheme-handler/ssh;
Categories=Utility;Application;
#!/usr/bin/python
import cloud
if __name__ == '__main__':
try:
cloud.main()
finally:
pass
# -*- coding: utf-8 -*-
##
# Távoli klienshez csatlakozás linux OS alól
##
import sys, os, time, subprocess, glob
##
# A távoli klienshez csatlakozás valósítja meg
# NX és RDP esetén a remmina programot hívja meg. Ha a remmina-ban még nem szerepel
# a kliens, a program elkészíti az indításhoz szükséges profilt.
# @param vm Paraméterek a csatlakozáshoz
# vm.protocol SSH, NX és RDP lehetséges
# vm.host A virtuális gép címe
# vm.port Ezen a porton csatlakozunk a virtuális géphez
# vm.user Csatlakozáshoz használt név
# vm.password Csatlakozáshoz használt jelszó
#
def connect(vm):
if vm.protocol == "SSH":
command = "sshpass -p %s ssh -p %s -o StrictHostKeyChecking=no %s@%s" % (vm.password, vm.port, vm.user, vm.host)
subprocess.call(command, shell=True)
elif vm.protocol in ("NX", "RDP"):
server = "%s:%s" % (vm.host, vm.port)
listdir = os.path.expanduser("~/.remmina/*.remmina")
found = False
for config_file in glob.glob(listdir):
with open(config_file) as f:
if server in f.read():
found = True
break
if not found:
config_file = "%s%s%s" % (os.path.expanduser("~/.remmina/"), str(int(time.time()*1000)), ".remmina")
password = subprocess.check_output(["remminapasswd", vm.password])
f = open(config_file, 'w')
if vm.protocol == "NX":
f.write(NX_template)
else:
f.write(RDP_template)
f.write("name=%s:%s\nprotocol=%s\nserver=%s\nusername=%s\npassword=%s\n" % (vm.protocol, server, vm.protocol, server, vm.user, password))
f.close()
subprocess.call(["remmina", "-c", config_file])
NX_template = """[remmina]
ssh_auth=0
quality=2
disableencryption=0
ssh_charset=
ssh_privatekey=
resolution=
group=
ssh_loopback=0
exec=
ssh_username=
ssh_server=
ssh_enabled=0
nx_privatekey=
showcursor=0
disableclipboard=0
window_maximize=1
viewmode=4
"""
RDP_template = """[remmina]
disableclipboard=0
ssh_auth=0
clientname=
quality=2
ssh_charset=
ssh_privatekey=
console=0
resolution=
group=
ssh_loopback=0
shareprinter=0
ssh_username=
ssh_server=
security=
execpath=
sound=off
exec=
ssh_enabled=0
sharefolder=
domain=
colordepth=24
window_maximize=1
viewmode=4
"""
#!/bin/bash
sudo apt-get install sshpass python-pip remmina-plugin-nx remmina-plugin-rdp xdg-user-dirs
sudo pip install selenium
if [ "$(uname -m)" == 'x86_64' ]; then
sudo cp x64/remminapasswd /usr/local/bin/remminapasswd
else
sudo cp x86/remminapasswd /usr/local/bin/remminapasswd
fi
sudo chmod +x /usr/local/bin/remminapasswd
sudo cp cloud2 /usr/local/bin/
sudo chmod +x /usr/local/bin/cloud2
sudo cp cloud.py /usr/local/bin/
sudo chmod +x /usr/local/bin/cloud.py
sudo cp cloud_connect_from_linux.py /usr/local/bin/
sudo chmod +x /usr/local/bin/cloud_connect_from_linux.py
sudo cp cloud.svg /usr/share/icons/
sudo cp cloud.desktop /usr/share/applications
sudo chmod +x /usr/share/applications/cloud.desktop
sudo update-desktop-database
cp cloud.desktop $(xdg-user-dir DESKTOP)
chmod +x $(xdg-user-dir DESKTOP)/cloud.desktop
remmina
\ No newline at end of file
......@@ -54,6 +54,7 @@ if '%errorlevel%' NEQ '0' (
@echo Elevated rights recived from UAC
)
:--------------------------------------
rem Start the installation script
IF NOT "!output_on_screen!"=="False" (
@echo Starting CIRCLE Client install script
......@@ -84,6 +85,7 @@ SET index=8
reg>nul query %@query% 2>nul
IF ERRORLEVEL 1 GOTO loop
IF ERRORLEVEL 0 GOTO HASPYTHON
pause
GOTO NOPYTHON
rem No 2.6+ Python is installed
......@@ -451,6 +453,8 @@ IF NOT "!output_on_screen!"=="False" (
)
xcopy>nul "%running_directory%cloud.py" "%install_location%\" /y
xcopy>nul "%running_directory%cloud_connect_from_windows.py" "%install_location%\" /y
xcopy>nul "%running_directory%win_install.py" "%install_location%\" /y
xcopy>nul "%running_directory%nx_client_installer.py" "%install_location%\" /y
xcopy>nul "%running_directory%nxkey.py" "%install_location%\" /y
xcopy>nul "%running_directory%OrderedDict.py" "%install_location%\" /y
xcopy>nul "%running_directory%cloud.ico" "%install_location%\" /y
......@@ -478,8 +482,6 @@ IF NOT "!output_on_screen!"=="False" (
IF NOT "!output_on_screen!"=="False" (
@echo Done
@echo Installation complete
@echo Press any key to close this installer
pause
)
GOTO END
......
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "CIRCLE Client"
#define MyAppVersion "1.0"
#define MyAppPublisher "BME IK, IIT, VIK"
#define MyAppURL "http://cloud.bme.hu/"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{86EFCEF4-69E1-4AE5-BF33-30FE7117F45D}
ExtraDiskSpaceRequired=2097140
PrivilegesRequired=poweruser
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={localappdata}\CIRCLE
DisableDirPage=yes
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=setup
SetupIconFile=C:\Users\Godhak\Desktop\client\dist\cloud.ico
UninstallIconFile=C:\Users\Godhak\Desktop\client\dist\cloud.ico
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
[Files]
; "installer" folder contains every necessary files except the uninstall.bat
Source: "installer\*"; DestDir: "{tmp}"; Flags: ignoreversion recursesubdirs createallsubdirs
; "uninstaller" folder contains ONLY the uninstall.bat
Source: "uninstaller\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Code]
procedure CurPageChanged(CurPageID: Integer);
var
ErrorCode: Integer;
show_stuff: String;
install_selenium: String;
page: String;
command: String;
OldState: Boolean;
begin
show_stuff := 'True';
install_selenium := 'False';
page := 'https://pc3.szgt.uni-miskolc.hu/'
command := show_stuff + ' ' + install_selenium + ' ' + AddQuotes(page)
case CurPageID of
wpFinished:
begin
if IsWin64 then
begin
OldState := EnableFsRedirection(False);
end;
try
Exec(ExpandConstant('{cmd}'), '/C '+AddQuotes(ExpandConstant('{tmp}\install.bat'))+ ' ' + command, '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
finally
if IsWin64 then
begin
EnableFsRedirection(OldState);
end;
end;
end;
end;
end;
[UninstallRun]
Filename: "{app}\uninstall.bat"; Parameters: "True"; Flags: waituntilterminated runascurrentuser shellexec
[Icons]
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
......@@ -54,6 +54,7 @@ if '%errorlevel%' NEQ '0' (
@echo Elevated rights recived from UAC
)
:--------------------------------------
rem Start the installation script
IF NOT "!output_on_screen!"=="False" (
@echo Starting CIRCLE Client install script
......@@ -84,6 +85,7 @@ SET index=8
reg>nul query %@query% 2>nul
IF ERRORLEVEL 1 GOTO loop
IF ERRORLEVEL 0 GOTO HASPYTHON
pause
GOTO NOPYTHON
rem No 2.6+ Python is installed
......@@ -451,6 +453,8 @@ IF NOT "!output_on_screen!"=="False" (
)
xcopy>nul "%running_directory%cloud.py" "%install_location%\" /y
xcopy>nul "%running_directory%cloud_connect_from_windows.py" "%install_location%\" /y
xcopy>nul "%running_directory%win_install.py" "%install_location%\" /y
xcopy>nul "%running_directory%nx_client_installer.py" "%install_location%\" /y
xcopy>nul "%running_directory%nxkey.py" "%install_location%\" /y
xcopy>nul "%running_directory%OrderedDict.py" "%install_location%\" /y
xcopy>nul "%running_directory%cloud.ico" "%install_location%\" /y
......@@ -478,8 +482,6 @@ IF NOT "!output_on_screen!"=="False" (
IF NOT "!output_on_screen!"=="False" (
@echo Done
@echo Installation complete
@echo Press any key to close this installer
pause
)
GOTO END
......
......@@ -59,7 +59,7 @@ def custom_protocol_register(custom_protocol):
# create a proper icon with the proper driver
# call the nx_client_installer
def main():
try:
#try:
args = pars_arguments()
shortcut = pythoncom.CoCreateInstance (
shell.CLSID_ShellLink,
......@@ -112,7 +112,7 @@ def main():
custom_protocol_register(custom_nx)
except:
print "Error! URL Protocol handler installation aborted!"
except:
print "Unknown error occurred! Please contact the developers!"
#except:
# print "Unknown error occurred! Please contact the developers!"
if __name__ == "__main__":
main()
\ No newline at end of file
......@@ -28,17 +28,18 @@ if not exist "%install_location%\" (
)
IF NOT "!output_on_screen!"=="False" (
@echo Installation direcory found at ^'%install_location%^'
@echo Removing files
)
rem Delete files and directory
rd>nul /q/s %install_location% 2>nul
IF NOT "!output_on_screen!"=="False" (
@echo Done
@echo Removing desktop icon
call python %running_directory%win_install.py ^-r
call python "%install_location%\win_install.py" ^-r
@echo Done
pause
@echo Removing files
) else (
call python %running_directory%win_install.py ^-r >nul 2>&1
call python "%install_location%\win_install.py" ^-r >nul 2>&1
)
rd>nul /q/s %install_location% 2>nul
IF NOT "!output_on_screen!"=="False" (
@echo Done
)
:end
\ No newline at end of file
......@@ -59,7 +59,7 @@ def custom_protocol_register(custom_protocol):
# create a proper icon with the proper driver
# call the nx_client_installer
def main():
try:
#try:
args = pars_arguments()
shortcut = pythoncom.CoCreateInstance (
shell.CLSID_ShellLink,
......@@ -112,7 +112,7 @@ def main():
custom_protocol_register(custom_nx)
except:
print "Error! URL Protocol handler installation aborted!"
except:
print "Unknown error occurred! Please contact the developers!"
#except:
# print "Unknown error occurred! Please contact the developers!"
if __name__ == "__main__":
main()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment