Commit 911273ea by Csók Tamás

changed Inno Setup to Nullsoft Scriptable Install System to solve compatibility issues

parent d3077f0d
A telepítéshez szükséges összes fájlt valamint a dokumentációt egy tömörített állomány tartalmazza.
1. Csomagoljuk ki az állományt egy tetszőleges helyre.
2. A következő lépésben nyissunk egy terminált és menjünk el (cd parancs) arra a mappára ahova az előbb kitömörí-tettünk.
3. Végül írjuk be: ./install.sh a konzolba.
A telepítés sikeres lefuttatásához szükség lesz majd megadni a jelszavunkat (vagy a rendszergazda jelszavát, helyi beállítástól függő-en).
A többit a szkript automatikusan végzi, amint végzett bezárhatjuk a konzolt és az asztalon megjelent ikonnal használhatjuk is a programot.
A program törlése hasonlóképpen zajlik, a kitömörített mappában adjuk ki a: ./uninstall.sh parancsot terminál segítségével (lsd. telepítés).
A szkript telepítéshez hasonló-an szintén kérni fog jelszót a törlés sikeres elvégzéséhez.
\ No newline at end of file
#!/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
#!/bin/bash
sudo rm -f /usr/local/bin/remminapasswd
sudo rm -f /usr/local/bin/cloud2
sudo rm -f /usr/local/bin/cloud.py
sudo rm -f /usr/local/bin/cloud_connect_from_linux.py
sudo rm -f /usr/share/icons/cloud.svg
rm -f $(xdg-user-dir DESKTOP)/cloud.desktop
\ No newline at end of file
#!/bin/bash
sudo rm -f /usr/local/bin/remminapasswd
sudo rm -f /usr/local/bin/cloud2
sudo rm -f /usr/local/bin/cloud.py
sudo rm -f /usr/local/bin/cloud_connect_from_linux.py
sudo rm -f /usr/share/icons/cloud.svg
rm -f $(xdg-user-dir DESKTOP)/cloud.desktop
\ No newline at end of file
# fordításhoz szükséges: libglib2.0-dev, libgtk2.0-dev, libgcrypt11-dev
gcc -DHAVE_LIBGCRYPT -o remminapasswd remmina_passwd.c remmina_crypt.c remmina_pref.c remmina_string_array.c -Wall `pkg-config --libs --cflags gtk+-2.0` `libgcrypt-config --cflags --libs`
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009 - Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <glib.h>
#ifdef HAVE_LIBGCRYPT
#include <gcrypt.h>
#endif
#include "remmina_pref.h"
#include "remmina_crypt.h"
#ifdef HAVE_LIBGCRYPT
static gboolean remmina_crypt_init(gcry_cipher_hd_t *phd)
{
guchar* secret;
gcry_error_t err;
gsize secret_len;
secret = g_base64_decode(remmina_pref.secret, &secret_len);
if (secret_len < 32)
{
g_print("secret corrupted\n");
g_free(secret);
return FALSE;
}
err = gcry_cipher_open(phd, GCRY_CIPHER_3DES, GCRY_CIPHER_MODE_CBC, 0);
if (err)
{
g_print("gcry_cipher_open failure: %s\n", gcry_strerror(err));
g_free(secret);
return FALSE;
}
err = gcry_cipher_setkey((*phd), secret, 24);
if (err)
{
g_print("gcry_cipher_setkey failure: %s\n", gcry_strerror(err));
g_free(secret);
gcry_cipher_close((*phd));
return FALSE;
}
err = gcry_cipher_setiv((*phd), secret + 24, 8);
if (err)
{
g_print("gcry_cipher_setiv failure: %s\n", gcry_strerror(err));
g_free(secret);
gcry_cipher_close((*phd));
return FALSE;
}
g_free(secret);
return TRUE;
}
gchar* remmina_crypt_encrypt(const gchar *str)
{
guchar* buf;
gint buf_len;
gchar* result;
gcry_error_t err;
gcry_cipher_hd_t hd;
if (!str || str[0] == '\0')
return NULL;
if (!remmina_crypt_init(&hd))
return NULL;
buf_len = strlen(str);
/* Pack to 64bit block size, and make sure it's always 0-terminated */
buf_len += 8 - buf_len % 8;
buf = (guchar*) g_malloc(buf_len);
memset(buf, 0, buf_len);
memcpy(buf, str, strlen(str));
err = gcry_cipher_encrypt(hd, buf, buf_len, NULL, 0);
if (err)
{
g_print("gcry_cipher_encrypt failure: %s\n", gcry_strerror(err));
g_free(buf);
gcry_cipher_close(hd);
return NULL;
}
result = g_base64_encode(buf, buf_len);
g_free(buf);
gcry_cipher_close(hd);
return result;
}
gchar* remmina_crypt_decrypt(const gchar *str)
{
guchar* buf;
gsize buf_len;
gcry_error_t err;
gcry_cipher_hd_t hd;
if (!str || str[0] == '\0')
return NULL;
if (!remmina_crypt_init(&hd))
return NULL;
buf = g_base64_decode(str, &buf_len);
err = gcry_cipher_decrypt(hd, buf, buf_len, NULL, 0);
if (err)
{
g_print("gcry_cipher_decrypt failure: %s\n", gcry_strerror(err));
g_free(buf);
gcry_cipher_close(hd);
return NULL;
}
gcry_cipher_close(hd);
/* Just in case */
buf[buf_len - 1] = '\0';
return (gchar*) buf;
}
#else
gchar* remmina_crypt_encrypt(const gchar *str)
{
return NULL;
}
gchar* remmina_crypt_decrypt(const gchar *str)
{
return NULL;
}
#endif
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009 - Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __REMMINACRYPT_H__
#define __REMMINACRYPT_H__
G_BEGIN_DECLS
gchar* remmina_crypt_encrypt(const gchar* str);
gchar* remmina_crypt_decrypt(const gchar* str);
G_END_DECLS
#endif /* __REMMINACRYPT_H__ */
#include <glib/gprintf.h>
#include "remmina_pref.h"
#include "remmina_crypt.h"
int main(int argc, char **argv)
{
if (argc == 2) {
remmina_pref_init();
g_printf("%s", remmina_crypt_encrypt(argv[1]));
return 0;
} else {
/* No (or too many) parameter(s) given, exit with code 1 to signal error */
return 1;
}
}
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009-2011 Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
#include <stdlib.h>
#include <string.h>
#include "remmina_string_array.h"
#include "remmina_pref.h"
const gchar *default_resolutions = "640x480,800x600,1024x768,1152x864,1280x960,1400x1050";
gchar *remmina_pref_file;
RemminaPref remmina_pref;
gchar *remmina_keymap_file;
static GHashTable *remmina_keymap_table = NULL;
/* We could customize this further if there are more requirements */
static const gchar *default_keymap_data = "# Please check gdk/gdkkeysyms.h for a full list of all key names or hex key values\n"
"\n"
"[Map Meta Keys]\n"
"Super_L = Meta_L\n"
"Super_R = Meta_R\n"
"Meta_L = Super_L\n"
"Meta_R = Super_R\n";
static void remmina_pref_gen_secret(void)
{
guchar s[32];
gint i;
GTimeVal gtime;
GKeyFile *gkeyfile;
gchar *content;
gsize length;
g_get_current_time(&gtime);
srand(gtime.tv_sec);
for (i = 0; i < 32; i++)
{
s[i] = (guchar)(rand() % 256);
}
remmina_pref.secret = g_base64_encode(s, 32);
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
g_key_file_set_string(gkeyfile, "remmina_pref", "secret", remmina_pref.secret);
content = g_key_file_to_data(gkeyfile, &length, NULL);
g_file_set_contents(remmina_pref_file, content, length, NULL);
g_key_file_free(gkeyfile);
g_free(content);
}
static guint remmina_pref_get_keyval_from_str(const gchar *str)
{
guint k;
if (!str)
return 0;
k = gdk_keyval_from_name(str);
if (!k)
{
if (sscanf(str, "%x", &k) < 1)
k = 0;
}
return k;
}
static void remmina_pref_init_keymap(void)
{
GKeyFile *gkeyfile;
gchar **groups;
gchar **gptr;
gchar **keys;
gchar **kptr;
gsize nkeys;
gchar *value;
guint *table;
guint *tableptr;
guint k1, k2;
if (remmina_keymap_table)
g_hash_table_destroy(remmina_keymap_table);
remmina_keymap_table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
gkeyfile = g_key_file_new();
if (!g_key_file_load_from_file(gkeyfile, remmina_keymap_file, G_KEY_FILE_NONE, NULL))
{
if (!g_key_file_load_from_data(gkeyfile, default_keymap_data, strlen(default_keymap_data), G_KEY_FILE_NONE,
NULL))
{
g_print("Failed to initialize keymap table\n");
g_key_file_free(gkeyfile);
return;
}
}
groups = g_key_file_get_groups(gkeyfile, NULL);
gptr = groups;
while (*gptr)
{
keys = g_key_file_get_keys(gkeyfile, *gptr, &nkeys, NULL);
table = g_new0(guint, nkeys * 2 + 1);
g_hash_table_insert(remmina_keymap_table, g_strdup(*gptr), table);
kptr = keys;
tableptr = table;
while (*kptr)
{
k1 = remmina_pref_get_keyval_from_str(*kptr);
if (k1)
{
value = g_key_file_get_string(gkeyfile, *gptr, *kptr, NULL);
k2 = remmina_pref_get_keyval_from_str(value);
g_free(value);
*tableptr++ = k1;
*tableptr++ = k2;
}
kptr++;
}
g_strfreev(keys);
gptr++;
}
g_strfreev(groups);
}
void remmina_pref_init(void)
{
GKeyFile *gkeyfile;
remmina_pref_file = g_strdup_printf("%s/.remmina/remmina.pref", g_get_home_dir());
remmina_keymap_file = g_strdup_printf("%s/.remmina/remmina.keymap", g_get_home_dir());
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
if (g_key_file_has_key(gkeyfile, "remmina_pref", "save_view_mode", NULL))
remmina_pref.save_view_mode = g_key_file_get_boolean(gkeyfile, "remmina_pref", "save_view_mode", NULL);
else
remmina_pref.save_view_mode = TRUE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "save_when_connect", NULL))
remmina_pref.save_when_connect = g_key_file_get_boolean(gkeyfile, "remmina_pref", "save_when_connect", NULL);
else
remmina_pref.save_when_connect = TRUE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "invisible_toolbar", NULL))
remmina_pref.invisible_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", "invisible_toolbar", NULL);
else
remmina_pref.invisible_toolbar = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "always_show_tab", NULL))
remmina_pref.always_show_tab = g_key_file_get_boolean(gkeyfile, "remmina_pref", "always_show_tab", NULL);
else
remmina_pref.always_show_tab = TRUE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_connection_toolbar", NULL))
remmina_pref.hide_connection_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref",
"hide_connection_toolbar", NULL);
else
remmina_pref.hide_connection_toolbar = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_action", NULL))
remmina_pref.default_action = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_action", NULL);
else
remmina_pref.default_action = REMMINA_ACTION_CONNECT;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "scale_quality", NULL))
remmina_pref.scale_quality = g_key_file_get_integer(gkeyfile, "remmina_pref", "scale_quality", NULL);
else
remmina_pref.scale_quality = GDK_INTERP_HYPER;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_toolbar", NULL))
remmina_pref.hide_toolbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", "hide_toolbar", NULL);
else
remmina_pref.hide_toolbar = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_statusbar", NULL))
remmina_pref.hide_statusbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", "hide_statusbar", NULL);
else
remmina_pref.hide_statusbar = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "show_quick_search", NULL))
remmina_pref.show_quick_search = g_key_file_get_boolean(gkeyfile, "remmina_pref", "show_quick_search", NULL);
else
remmina_pref.show_quick_search = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "small_toolbutton", NULL))
remmina_pref.small_toolbutton = g_key_file_get_boolean(gkeyfile, "remmina_pref", "small_toolbutton", NULL);
else
remmina_pref.small_toolbutton = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "view_file_mode", NULL))
remmina_pref.view_file_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "view_file_mode", NULL);
else
remmina_pref.view_file_mode = REMMINA_VIEW_FILE_LIST;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "resolutions", NULL))
remmina_pref.resolutions = g_key_file_get_string(gkeyfile, "remmina_pref", "resolutions", NULL);
else
remmina_pref.resolutions = g_strdup(default_resolutions);
if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_width", NULL))
remmina_pref.main_width = MAX(600, g_key_file_get_integer(gkeyfile, "remmina_pref", "main_width", NULL));
else
remmina_pref.main_width = 600;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_height", NULL))
remmina_pref.main_height = MAX(400, g_key_file_get_integer(gkeyfile, "remmina_pref", "main_height", NULL));
else
remmina_pref.main_height = 400;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_maximize", NULL))
remmina_pref.main_maximize = g_key_file_get_boolean(gkeyfile, "remmina_pref", "main_maximize", NULL);
else
remmina_pref.main_maximize = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_sort_column_id", NULL))
remmina_pref.main_sort_column_id = g_key_file_get_integer(gkeyfile, "remmina_pref", "main_sort_column_id",
NULL);
else
remmina_pref.main_sort_column_id = 1;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "main_sort_order", NULL))
remmina_pref.main_sort_order = g_key_file_get_integer(gkeyfile, "remmina_pref", "main_sort_order", NULL);
else
remmina_pref.main_sort_order = 0;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "expanded_group", NULL))
remmina_pref.expanded_group = g_key_file_get_string(gkeyfile, "remmina_pref", "expanded_group", NULL);
else
remmina_pref.expanded_group = g_strdup("");
if (g_key_file_has_key(gkeyfile, "remmina_pref", "toolbar_pin_down", NULL))
remmina_pref.toolbar_pin_down = g_key_file_get_boolean(gkeyfile, "remmina_pref", "toolbar_pin_down", NULL);
else
remmina_pref.toolbar_pin_down = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "sshtunnel_port", NULL))
remmina_pref.sshtunnel_port = g_key_file_get_integer(gkeyfile, "remmina_pref", "sshtunnel_port", NULL);
else
remmina_pref.sshtunnel_port = DEFAULT_SSHTUNNEL_PORT;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_new_ontop", NULL))
remmina_pref.applet_new_ontop = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_new_ontop", NULL);
else
remmina_pref.applet_new_ontop = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_hide_count", NULL))
remmina_pref.applet_hide_count = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_hide_count", NULL);
else
remmina_pref.applet_hide_count = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "applet_enable_avahi", NULL))
remmina_pref.applet_enable_avahi = g_key_file_get_boolean(gkeyfile, "remmina_pref", "applet_enable_avahi",
NULL);
else
remmina_pref.applet_enable_avahi = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "disable_tray_icon", NULL))
remmina_pref.disable_tray_icon = g_key_file_get_boolean(gkeyfile, "remmina_pref", "disable_tray_icon", NULL);
else
remmina_pref.disable_tray_icon = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "minimize_to_tray", NULL))
remmina_pref.minimize_to_tray = g_key_file_get_boolean(gkeyfile, "remmina_pref", "minimize_to_tray", NULL);
else
remmina_pref.minimize_to_tray = FALSE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "recent_maximum", NULL))
remmina_pref.recent_maximum = g_key_file_get_integer(gkeyfile, "remmina_pref", "recent_maximum", NULL);
else
remmina_pref.recent_maximum = 10;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_mode", NULL))
remmina_pref.default_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_mode", NULL);
else
remmina_pref.default_mode = 0;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "tab_mode", NULL))
remmina_pref.tab_mode = g_key_file_get_integer(gkeyfile, "remmina_pref", "tab_mode", NULL);
else
remmina_pref.tab_mode = 0;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "auto_scroll_step", NULL))
remmina_pref.auto_scroll_step = g_key_file_get_integer(gkeyfile, "remmina_pref", "auto_scroll_step", NULL);
else
remmina_pref.auto_scroll_step = 10;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "hostkey", NULL))
remmina_pref.hostkey = g_key_file_get_integer(gkeyfile, "remmina_pref", "hostkey", NULL);
else
remmina_pref.hostkey = GDK_KEY_Control_R;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", NULL))
remmina_pref.shortcutkey_fullscreen = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen",
NULL);
else
remmina_pref.shortcutkey_fullscreen = GDK_KEY_f;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_autofit", NULL))
remmina_pref.shortcutkey_autofit = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_autofit",
NULL);
else
remmina_pref.shortcutkey_autofit = GDK_KEY_1;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_nexttab", NULL))
remmina_pref.shortcutkey_nexttab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_nexttab",
NULL);
else
remmina_pref.shortcutkey_nexttab = GDK_KEY_Right;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_prevtab", NULL))
remmina_pref.shortcutkey_prevtab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_prevtab",
NULL);
else
remmina_pref.shortcutkey_prevtab = GDK_KEY_Left;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_scale", NULL))
remmina_pref.shortcutkey_scale = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_scale", NULL);
else
remmina_pref.shortcutkey_scale = GDK_KEY_s;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_grab", NULL))
remmina_pref.shortcutkey_grab = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_grab", NULL);
else
remmina_pref.shortcutkey_grab = GDK_KEY_Control_R;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_minimize", NULL))
remmina_pref.shortcutkey_minimize = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_minimize",
NULL);
else
remmina_pref.shortcutkey_minimize = GDK_KEY_F9;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_disconnect", NULL))
remmina_pref.shortcutkey_disconnect = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_disconnect",
NULL);
else
remmina_pref.shortcutkey_disconnect = GDK_KEY_F4;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "shortcutkey_toolbar", NULL))
remmina_pref.shortcutkey_toolbar = g_key_file_get_integer(gkeyfile, "remmina_pref", "shortcutkey_toolbar",
NULL);
else
remmina_pref.shortcutkey_toolbar = GDK_KEY_t;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "secret", NULL))
remmina_pref.secret = g_key_file_get_string(gkeyfile, "remmina_pref", "secret", NULL);
else
remmina_pref.secret = NULL;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_font", NULL))
remmina_pref.vte_font = g_key_file_get_string(gkeyfile, "remmina_pref", "vte_font", NULL);
else
remmina_pref.vte_font = NULL;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_allow_bold_text", NULL))
remmina_pref.vte_allow_bold_text = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_allow_bold_text",
NULL);
else
remmina_pref.vte_allow_bold_text = TRUE;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_lines", NULL))
remmina_pref.vte_lines = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_lines", NULL);
else
remmina_pref.vte_lines = 512;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_copy", NULL))
remmina_pref.vte_shortcutkey_copy = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_copy",
NULL);
else
remmina_pref.vte_shortcutkey_copy = GDK_KEY_c;
if (g_key_file_has_key(gkeyfile, "remmina_pref", "vte_shortcutkey_paste", NULL))
remmina_pref.vte_shortcutkey_paste = g_key_file_get_integer(gkeyfile, "remmina_pref", "vte_shortcutkey_paste",
NULL);
else
remmina_pref.vte_shortcutkey_paste = GDK_KEY_v;
g_key_file_free(gkeyfile);
if (remmina_pref.secret == NULL)
remmina_pref_gen_secret();
remmina_pref_init_keymap();
}
void remmina_pref_save(void)
{
GKeyFile *gkeyfile;
gchar *content;
gsize length;
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_view_mode", remmina_pref.save_view_mode);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "save_when_connect", remmina_pref.save_when_connect);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "invisible_toolbar", remmina_pref.invisible_toolbar);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_tab", remmina_pref.always_show_tab);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar);
g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action);
g_key_file_set_integer(gkeyfile, "remmina_pref", "scale_quality", remmina_pref.scale_quality);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_toolbar", remmina_pref.hide_toolbar);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_statusbar", remmina_pref.hide_statusbar);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "show_quick_search", remmina_pref.show_quick_search);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "small_toolbutton", remmina_pref.small_toolbutton);
g_key_file_set_integer(gkeyfile, "remmina_pref", "view_file_mode", remmina_pref.view_file_mode);
g_key_file_set_string(gkeyfile, "remmina_pref", "resolutions", remmina_pref.resolutions);
g_key_file_set_integer(gkeyfile, "remmina_pref", "main_width", remmina_pref.main_width);
g_key_file_set_integer(gkeyfile, "remmina_pref", "main_height", remmina_pref.main_height);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "main_maximize", remmina_pref.main_maximize);
g_key_file_set_integer(gkeyfile, "remmina_pref", "main_sort_column_id", remmina_pref.main_sort_column_id);
g_key_file_set_integer(gkeyfile, "remmina_pref", "main_sort_order", remmina_pref.main_sort_order);
g_key_file_set_string(gkeyfile, "remmina_pref", "expanded_group", remmina_pref.expanded_group);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "toolbar_pin_down", remmina_pref.toolbar_pin_down);
g_key_file_set_integer(gkeyfile, "remmina_pref", "sshtunnel_port", remmina_pref.sshtunnel_port);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_new_ontop", remmina_pref.applet_new_ontop);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_hide_count", remmina_pref.applet_hide_count);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "applet_enable_avahi", remmina_pref.applet_enable_avahi);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "disable_tray_icon", remmina_pref.disable_tray_icon);
g_key_file_set_boolean(gkeyfile, "remmina_pref", "minimize_to_tray", remmina_pref.minimize_to_tray);
g_key_file_set_integer(gkeyfile, "remmina_pref", "recent_maximum", remmina_pref.recent_maximum);
g_key_file_set_integer(gkeyfile, "remmina_pref", "default_mode", remmina_pref.default_mode);
g_key_file_set_integer(gkeyfile, "remmina_pref", "tab_mode", remmina_pref.tab_mode);
g_key_file_set_integer(gkeyfile, "remmina_pref", "auto_scroll_step", remmina_pref.auto_scroll_step);
g_key_file_set_integer(gkeyfile, "remmina_pref", "hostkey", remmina_pref.hostkey);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_fullscreen", remmina_pref.shortcutkey_fullscreen);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_autofit", remmina_pref.shortcutkey_autofit);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_nexttab", remmina_pref.shortcutkey_nexttab);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_prevtab", remmina_pref.shortcutkey_prevtab);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_scale", remmina_pref.shortcutkey_scale);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_grab", remmina_pref.shortcutkey_grab);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_minimize", remmina_pref.shortcutkey_minimize);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_disconnect", remmina_pref.shortcutkey_disconnect);
g_key_file_set_integer(gkeyfile, "remmina_pref", "shortcutkey_toolbar", remmina_pref.shortcutkey_toolbar);
g_key_file_set_string(gkeyfile, "remmina_pref", "vte_font", remmina_pref.vte_font ? remmina_pref.vte_font : "");
g_key_file_set_boolean(gkeyfile, "remmina_pref", "vte_allow_bold_text", remmina_pref.vte_allow_bold_text);
g_key_file_set_integer(gkeyfile, "remmina_pref", "vte_lines", remmina_pref.vte_lines);
content = g_key_file_to_data(gkeyfile, &length, NULL);
g_file_set_contents(remmina_pref_file, content, length, NULL);
g_key_file_free(gkeyfile);
g_free(content);
}
void remmina_pref_add_recent(const gchar *protocol, const gchar *server)
{
RemminaStringArray *array;
GKeyFile *gkeyfile;
gchar key[20];
gchar *val;
gchar *content;
gsize length;
if (remmina_pref.recent_maximum <= 0 || server == NULL || server[0] == 0)
return;
/* Load original value into memory */
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
g_snprintf(key, sizeof(key), "recent_%s", protocol);
array = remmina_string_array_new_from_allocated_string(g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL));
/* Add the new value */
remmina_string_array_remove(array, server);
while (array->len >= remmina_pref.recent_maximum)
{
remmina_string_array_remove_index(array, 0);
}
remmina_string_array_add(array, server);
/* Save */
val = remmina_string_array_to_string(array);
g_key_file_set_string(gkeyfile, "remmina_pref", key, val);
g_free(val);
content = g_key_file_to_data(gkeyfile, &length, NULL);
g_file_set_contents(remmina_pref_file, content, length, NULL);
g_key_file_free(gkeyfile);
g_free(content);
}
gchar*
remmina_pref_get_recent(const gchar *protocol)
{
GKeyFile *gkeyfile;
gchar key[20];
gchar *val;
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
g_snprintf(key, sizeof(key), "recent_%s", protocol);
val = g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL);
g_key_file_free(gkeyfile);
return val;
}
void remmina_pref_clear_recent(void)
{
GKeyFile *gkeyfile;
gchar **keys;
gint i;
gchar *content;
gsize length;
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
keys = g_key_file_get_keys(gkeyfile, "remmina_pref", NULL, NULL);
if (keys)
{
for (i = 0; keys[i]; i++)
{
if (strncmp(keys[i], "recent_", 7) == 0)
{
g_key_file_set_string(gkeyfile, "remmina_pref", keys[i], "");
}
}
g_strfreev(keys);
}
content = g_key_file_to_data(gkeyfile, &length, NULL);
g_file_set_contents(remmina_pref_file, content, length, NULL);
g_key_file_free(gkeyfile);
g_free(content);
}
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval)
{
guint *table;
gint i;
if (!keymap || keymap[0] == '\0')
return keyval;
table = (guint*) g_hash_table_lookup(remmina_keymap_table, keymap);
if (!table)
return keyval;
for (i = 0; table[i] > 0; i += 2)
{
if (table[i] == keyval)
return table[i + 1];
}
return keyval;
}
gchar**
remmina_pref_keymap_groups(void)
{
GList *list;
guint len;
gchar **keys;
guint i;
list = g_hash_table_get_keys(remmina_keymap_table);
len = g_list_length(list);
keys = g_new0 (gchar*, (len + 1) * 2 + 1);
keys[0] = g_strdup("");
keys[1] = g_strdup("");
for (i = 0; i < len; i++)
{
keys[(i + 1) * 2] = g_strdup((gchar*) g_list_nth_data(list, i));
keys[(i + 1) * 2 + 1] = g_strdup((gchar*) g_list_nth_data(list, i));
}
g_list_free(list);
return keys;
}
gint remmina_pref_get_scale_quality(void)
{
return remmina_pref.scale_quality;
}
gint remmina_pref_get_sshtunnel_port(void)
{
return remmina_pref.sshtunnel_port;
}
void remmina_pref_set_value(const gchar *key, const gchar *value)
{
GKeyFile *gkeyfile;
gchar *content;
gsize length;
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
g_key_file_set_string(gkeyfile, "remmina_pref", key, value);
content = g_key_file_to_data(gkeyfile, &length, NULL);
g_file_set_contents(remmina_pref_file, content, length, NULL);
g_key_file_free(gkeyfile);
g_free(content);
}
gchar*
remmina_pref_get_value(const gchar *key)
{
GKeyFile *gkeyfile;
gchar *value;
gkeyfile = g_key_file_new();
g_key_file_load_from_file(gkeyfile, remmina_pref_file, G_KEY_FILE_NONE, NULL);
value = g_key_file_get_string(gkeyfile, "remmina_pref", key, NULL);
g_key_file_free(gkeyfile);
return value;
}
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009-2011 Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __REMMINAPREF_H__
#define __REMMINAPREF_H__
/*
* Remmina Perference Loader
*/
G_BEGIN_DECLS
enum
{
REMMINA_VIEW_FILE_LIST,
REMMINA_VIEW_FILE_TREE
};
enum
{
REMMINA_ACTION_CONNECT = 0,
REMMINA_ACTION_EDIT = 1
};
enum
{
AUTO_MODE = 0,
SCROLLED_WINDOW_MODE = 1,
FULLSCREEN_MODE = 2,
SCROLLED_FULLSCREEN_MODE = 3,
VIEWPORT_FULLSCREEN_MODE = 4
};
enum
{
REMMINA_TAB_BY_GROUP = 0,
REMMINA_TAB_BY_PROTOCOL = 1,
REMMINA_TAB_ALL = 8,
REMMINA_TAB_NONE = 9
};
typedef struct _RemminaPref
{
/* In RemminaPrefDialog */
gboolean save_view_mode;
gboolean save_when_connect;
gboolean invisible_toolbar;
gboolean always_show_tab;
gboolean hide_connection_toolbar;
gint default_action;
gint scale_quality;
gchar *resolutions;
gint sshtunnel_port;
gint recent_maximum;
gint default_mode;
gint tab_mode;
gint auto_scroll_step;
gboolean applet_new_ontop;
gboolean applet_hide_count;
gboolean applet_enable_avahi;
gboolean disable_tray_icon;
gboolean minimize_to_tray;
guint hostkey;
guint shortcutkey_fullscreen;
guint shortcutkey_autofit;
guint shortcutkey_nexttab;
guint shortcutkey_prevtab;
guint shortcutkey_scale;
guint shortcutkey_grab;
guint shortcutkey_minimize;
guint shortcutkey_disconnect;
guint shortcutkey_toolbar;
/* In View menu */
gboolean hide_toolbar;
gboolean hide_statusbar;
gboolean show_quick_search;
gboolean small_toolbutton;
gint view_file_mode;
/* Auto */
gint main_width;
gint main_height;
gboolean main_maximize;
gint main_sort_column_id;
gint main_sort_order;
gchar *expanded_group;
gboolean toolbar_pin_down;
/* Crypto */
gchar *secret;
/* VTE */
gchar *vte_font;
gboolean vte_allow_bold_text;
gint vte_lines;
guint vte_shortcutkey_copy;
guint vte_shortcutkey_paste;
} RemminaPref;
#define DEFAULT_SSHTUNNEL_PORT 4732
#define DEFAULT_SSH_PORT 22
extern const gchar *default_resolutions;
extern gchar *remmina_pref_file;
extern RemminaPref remmina_pref;
void remmina_pref_init(void);
void remmina_pref_save(void);
void remmina_pref_add_recent(const gchar *protocol, const gchar *server);
gchar* remmina_pref_get_recent(const gchar *protocol);
void remmina_pref_clear_recent(void);
guint remmina_pref_keymap_get_keyval(const gchar *keymap, guint keyval);
gchar** remmina_pref_keymap_groups(void);
gint remmina_pref_get_scale_quality(void);
gint remmina_pref_get_sshtunnel_port(void);
void remmina_pref_set_value(const gchar *key, const gchar *value);
gchar* remmina_pref_get_value(const gchar *key);
G_END_DECLS
#endif /* __REMMINAPREF_H__ */
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009 - Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <glib.h>
#include <string.h>
#include "remmina_string_array.h"
RemminaStringArray*
remmina_string_array_new(void)
{
return g_ptr_array_new();
}
RemminaStringArray*
remmina_string_array_new_from_string(const gchar *strs)
{
RemminaStringArray *array;
gchar *buf, *ptr1, *ptr2;
array = remmina_string_array_new();
if (!strs || strs[0] == '\0')
return array;
buf = g_strdup(strs);
ptr1 = buf;
while (ptr1)
{
ptr2 = strchr(ptr1, ',');
if (ptr2)
*ptr2++ = '\0';
remmina_string_array_add(array, ptr1);
ptr1 = ptr2;
}
g_free(buf);
return array;
}
RemminaStringArray*
remmina_string_array_new_from_allocated_string(gchar *strs)
{
RemminaStringArray *array;
array = remmina_string_array_new_from_string(strs);
g_free(strs);
return array;
}
void remmina_string_array_add(RemminaStringArray* array, const gchar *str)
{
g_ptr_array_add(array, g_strdup(str));
}
gint remmina_string_array_find(RemminaStringArray* array, const gchar *str)
{
gint i;
for (i = 0; i < array->len; i++)
{
if (g_strcmp0(remmina_string_array_index(array, i), str) == 0)
return i;
}
return -1;
}
void remmina_string_array_remove_index(RemminaStringArray* array, gint i)
{
g_ptr_array_remove_index(array, i);
}
void remmina_string_array_remove(RemminaStringArray* array, const gchar *str)
{
gint i;
i = remmina_string_array_find(array, str);
if (i >= 0)
{
remmina_string_array_remove_index(array, i);
}
}
void remmina_string_array_intersect(RemminaStringArray* array, const gchar *dest_strs)
{
RemminaStringArray *dest_array;
gint i, j;
dest_array = remmina_string_array_new_from_string(dest_strs);
i = 0;
while (i < array->len)
{
j = remmina_string_array_find(dest_array, remmina_string_array_index(array, i));
if (j < 0)
{
remmina_string_array_remove_index(array, i);
continue;
}
i++;
}
remmina_string_array_free(dest_array);
}
static gint remmina_string_array_compare_func(const gchar **a, const gchar **b)
{
return g_strcmp0(*a, *b);
}
void remmina_string_array_sort(RemminaStringArray *array)
{
g_ptr_array_sort(array, (GCompareFunc) remmina_string_array_compare_func);
}
gchar*
remmina_string_array_to_string(RemminaStringArray* array)
{
GString *gstr;
gint i;
gstr = g_string_new("");
for (i = 0; i < array->len; i++)
{
if (i > 0)
g_string_append_c(gstr, ',');
g_string_append(gstr, remmina_string_array_index(array, i));
}
return g_string_free(gstr, FALSE);
}
void remmina_string_array_free(RemminaStringArray *array)
{
g_ptr_array_foreach(array, (GFunc) g_free, NULL);
g_ptr_array_free(array, TRUE);
}
/*
* Remmina - The GTK+ Remote Desktop Client
* Copyright (C) 2009 - Vic Lee
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __REMMINASTRINGARRAY_H__
#define __REMMINASTRINGARRAY_H__
G_BEGIN_DECLS
typedef GPtrArray RemminaStringArray;
RemminaStringArray* remmina_string_array_new(void);
#define remmina_string_array_index(array,i) (gchar*)g_ptr_array_index(array,i)
RemminaStringArray* remmina_string_array_new_from_string(const gchar *strs);
RemminaStringArray* remmina_string_array_new_from_allocated_string(gchar *strs);
void remmina_string_array_add(RemminaStringArray *array, const gchar *str);
gint remmina_string_array_find(RemminaStringArray *array, const gchar *str);
void remmina_string_array_remove_index(RemminaStringArray *array, gint i);
void remmina_string_array_remove(RemminaStringArray *array, const gchar *str);
void remmina_string_array_intersect(RemminaStringArray *array, const gchar *dest_strs);
void remmina_string_array_sort(RemminaStringArray *array);
gchar* remmina_string_array_to_string(RemminaStringArray *array);
void remmina_string_array_free(RemminaStringArray *array);
G_END_DECLS
#endif /* __REMMINASTRINGARRAY_H__ */
[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;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32px"
height="32px"
id="svg4113"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="cloud.svg"
inkscape:export-filename="/home/maat/Munka/IK/cloud/miscellaneous/laborclient/cloudgui/cloud.png"
inkscape:export-xdpi="180"
inkscape:export-ydpi="180">
<defs
id="defs4115">
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3034"
id="radialGradient6745"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.91098464,-0.68941106,-0.52931253,-0.699431,40.047884,602.97172)"
cx="391.42856"
cy="287.43375"
fx="391.42856"
fy="287.43375"
r="145.96571" />
<linearGradient
inkscape:collect="always"
id="linearGradient3034">
<stop
style="stop-color:#aaccee;stop-opacity:1;"
offset="0"
id="stop3036" />
<stop
style="stop-color:#aaccee;stop-opacity:0;"
offset="1"
id="stop3038" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3024"
id="radialGradient6747"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.80253714,-0.60679623,0.29834416,0.39458642,-154.50478,207.30449)"
cx="318.85928"
cy="314.71725"
fx="318.85928"
fy="314.71725"
r="145.96571" />
<linearGradient
inkscape:collect="always"
id="linearGradient3024">
<stop
style="stop-color:#b3defd;stop-opacity:0.5"
offset="0"
id="stop3026" />
<stop
style="stop-color:#b3defd;stop-opacity:0;"
offset="1"
id="stop3028" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3050"
id="radialGradient6749"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.95668304,-0.34646122,0.16844062,0.46511873,-181.17636,116.47568)"
cx="292.64816"
cy="299.75269"
fx="292.64816"
fy="299.75269"
r="145.96571" />
<linearGradient
id="linearGradient3050"
inkscape:collect="always">
<stop
id="stop3052"
offset="0"
style="stop-color:#b3defd;stop-opacity:0.5" />
<stop
id="stop3054"
offset="1"
style="stop-color:#b3defd;stop-opacity:0.7" />
</linearGradient>
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3034"
id="radialGradient7457"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.91098464,-0.68941106,-0.52931253,-0.699431,40.047884,602.97172)"
cx="391.42856"
cy="287.43375"
fx="391.42856"
fy="287.43375"
r="145.96571" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3024"
id="radialGradient7459"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.80253714,-0.60679623,0.29834416,0.39458642,-154.50478,207.30449)"
cx="318.85928"
cy="314.71725"
fx="318.85928"
fy="314.71725"
r="145.96571" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3050"
id="radialGradient7461"
gradientUnits="userSpaceOnUse"
gradientTransform="matrix(0.95668304,-0.34646122,0.16844062,0.46511873,-181.17636,116.47568)"
cx="292.64816"
cy="299.75269"
fx="292.64816"
fy="299.75269"
r="145.96571" />
<radialGradient
r="145.96571"
fy="299.75269"
fx="292.64816"
cy="299.75269"
cx="292.64816"
gradientTransform="matrix(0.95668304,-0.34646122,0.16844062,0.46511873,-181.17636,116.47568)"
gradientUnits="userSpaceOnUse"
id="radialGradient4111"
xlink:href="#linearGradient3050"
inkscape:collect="always" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.9180417"
inkscape:cx="6.6070506"
inkscape:cy="11.63422"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:grid-bbox="true"
inkscape:document-units="px"
inkscape:window-width="950"
inkscape:window-height="1061"
inkscape:window-x="0"
inkscape:window-y="17"
inkscape:window-maximized="0" />
<metadata
id="metadata4118">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:label="Layer 1"
inkscape:groupmode="layer">
<g
id="g6661"
transform="matrix(0.10449644,0,0,0.10449644,-9.9531247,2.8799027)"
inkscape:export-filename="/home/maat/Munka/IK/cloud/miscellaneous/homepage/IK Cloud_files/cloud-migration.png"
inkscape:export-xdpi="61.548325"
inkscape:export-ydpi="61.548325">
<path
style="fill:url(#radialGradient7457);fill-opacity:1;stroke:none"
d="m 256.14524,59.11126 c 24.62625,2.347316 49.86777,32.49978 53.75856,51.16324 8.62329,-27.43498 50.34441,-17.171137 59.85333,-0.71968 6.65814,11.5193 48.45788,5.51236 28.44657,28.00035 24.27442,15.34513 20.8571,65.07012 -42.70377,65.95822 l -176.71875,0 c -42.76196,-1.07615 -51.32274,-8.1926 -57.875,-33.40625 -5.53769,-21.30947 22.49377,-78.5932 62.40625,-64.25 11.6223,-24.03732 44.1151,-49.483183 72.83281,-46.74588 z"
id="path6663"
inkscape:connector-curvature="0"
sodipodi:nodetypes="acscccsca" />
<path
sodipodi:nodetypes="acacccsca"
inkscape:connector-curvature="0"
id="path6665"
d="M 276.48862,56.4684 C 249.95136,55.91176 211.62085,77.96818 207.73006,96.63164 199.10677,69.19666 174.15148,70.8254 157.87673,77.91196 c -18.8365,8.20202 -43.45788,34.51236 -23.44657,57.00036 -24.27442,15.34513 -20.8571,65.07012 42.70377,65.95822 l 176.71875,0 c 42.76196,-1.07615 51.32274,-8.1926 57.875,-33.40625 5.53769,-21.30947 -22.49377,-78.59321 -62.40625,-64.25001 -11.6223,-24.03732 -43.99128,-46.1409 -72.83281,-46.74588 z"
style="fill:url(#radialGradient7459);fill-opacity:1;stroke:none" />
<path
style="fill:url(#radialGradient4111);fill-opacity:1;stroke:none"
d="m 255.98862,62.9684 c -26.53726,-0.55664 -64.86777,21.49978 -68.75856,40.16324 -8.62329,-27.43498 -33.57858,-25.80624 -49.85333,-18.71968 -18.8365,8.20202 -43.45788,34.51236 -23.44657,57.00036 -24.27442,15.34513 -20.8571,65.07012 42.70377,65.95822 l 176.71875,0 c 42.76196,-1.07615 51.32274,-8.1926 57.875,-33.40625 5.53769,-21.30947 -22.49377,-78.59321 -62.40625,-64.25001 -11.6223,-24.03732 -43.99128,-46.1409 -72.83281,-46.74588 z"
id="path6667"
inkscape:connector-curvature="0"
sodipodi:nodetypes="acacccsca" />
</g>
<g
transform="matrix(0.10449644,0,0,0.10449644,-9.9531247,2.8799027)"
id="g7143"
inkscape:export-filename="/home/maat/Munka/IK/cloud/miscellaneous/homepage/IK Cloud_files/cloud-migration.png"
inkscape:export-xdpi="61.548325"
inkscape:export-ydpi="61.548325">
<path
sodipodi:nodetypes="acscccsca"
inkscape:connector-curvature="0"
id="path7145"
d="m 256.14524,59.11126 c 24.62625,2.347316 49.86777,32.49978 53.75856,51.16324 8.62329,-27.43498 50.34441,-17.171137 59.85333,-0.71968 6.65814,11.5193 48.45788,5.51236 28.44657,28.00035 24.27442,15.34513 20.8571,65.07012 -42.70377,65.95822 l -176.71875,0 c -42.76196,-1.07615 -51.32274,-8.1926 -57.875,-33.40625 -5.53769,-21.30947 22.49377,-78.5932 62.40625,-64.25 11.6223,-24.03732 44.1151,-49.483183 72.83281,-46.74588 z"
style="fill:url(#radialGradient6745);fill-opacity:1;stroke:none" />
<path
style="fill:url(#radialGradient6747);fill-opacity:1;stroke:none"
d="M 276.48862,56.4684 C 249.95136,55.91176 211.62085,77.96818 207.73006,96.63164 199.10677,69.19666 174.15148,70.8254 157.87673,77.91196 c -18.8365,8.20202 -43.45788,34.51236 -23.44657,57.00036 -24.27442,15.34513 -20.8571,65.07012 42.70377,65.95822 l 176.71875,0 c 42.76196,-1.07615 51.32274,-8.1926 57.875,-33.40625 5.53769,-21.30947 -22.49377,-78.59321 -62.40625,-64.25001 -11.6223,-24.03732 -43.99128,-46.1409 -72.83281,-46.74588 z"
id="path7147"
inkscape:connector-curvature="0"
sodipodi:nodetypes="acacccsca" />
<path
sodipodi:nodetypes="acacccsca"
inkscape:connector-curvature="0"
id="path7149"
d="m 255.98862,62.9684 c -26.53726,-0.55664 -64.86777,21.49978 -68.75856,40.16324 -8.62329,-27.43498 -33.57858,-25.80624 -49.85333,-18.71968 -18.8365,8.20202 -43.45788,34.51236 -23.44657,57.00036 -24.27442,15.34513 -20.8571,65.07012 42.70377,65.95822 l 176.71875,0 c 42.76196,-1.07615 51.32274,-8.1926 57.875,-33.40625 5.53769,-21.30947 -22.49377,-78.59321 -62.40625,-64.25001 -11.6223,-24.03732 -43.99128,-46.1409 -72.83281,-46.74588 z"
style="fill:url(#radialGradient6749);fill-opacity:1;stroke:none" />
</g>
<path
style="color:#000000;fill:#023397;fill-opacity:1;fill-rule:nonzero;stroke:#013397;stroke-width:0.94207054;stroke-miterlimit:4;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
d="M 1.5063263,16.860746 C 0.4156576,11.32735 5.5426162,6.5060803 9.4930905,12.794092 12.390583,10.362512 18.261384,5.4751042 21.924479,10.356943 c 4.63917,5.709372 8.828435,2.091553 9.150998,7.200829 1.718965,7.440276 -8.53632,6.237142 -13.058126,7.023742 -5.243812,-0.597269 -11.6068286,1.83668 -16.0931921,-1.584416 -2.83679016,-2.868664 0.4677062,-8.372045 -0.256227,-3.038949 1.6721659,5.015472 8.2408874,3.367343 12.1150121,3.959711 4.986922,-0.85089 11.314427,1.082767 15.334753,-2.286781 2.765266,-4.396332 1.928251,-6.112638 -6.005384,-8.869924 C 20.710434,8.941212 14.735657,9.414075 11.152431,12.552675 6.4967083,13.692321 4.221964,7.4719519 2.0955523,15.655441 l -0.2846878,0.607473 z"
id="path7850"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccccc"
inkscape:export-filename="/home/maat/Munka/IK/cloud/miscellaneous/homepage/IK Cloud_files/cloud-migration.png"
inkscape:export-xdpi="61.548325"
inkscape:export-ydpi="61.548325" />
</g>
</svg>
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "CIRCLE Client"
#define MyAppProgramInfo "Visit the CIRCLE"
#define MyAppProgram "Cloud GUI.url"
#define MyAppDir "{userappdata}\CIRCLE"
#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=installer\cloud.ico
UninstallIconFile=installer\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://cloud.bme.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}"
Name: "{group}\{#MyAppProgramInfo}"; Filename: "{#MyAppDir}\{#MyAppProgram}"; IconFilename: "{#MyAppDir}\cloud.ico"
@echo off
:addPath pathVar /B
::
:: Safely appends the path contained within variable pathVar to the end
:: of PATH if and only if the path does not already exist within PATH.
::
:: If the case insensitive /B option is specified, then the path is
:: inserted into the front (Beginning) of PATH instead.
::
:: If the pathVar path is fully qualified, then it is logically compared
:: to each fully qualified path within PATH. The path strings are
:: considered a match if they are logically equivalent.
::
:: If the pathVar path is relative, then it is strictly compared to each
:: relative path within PATH. Case differences and double quotes are
:: ignored, but otherwise the path strings must match exactly.
::
:: Before appending the pathVar path, all double quotes are stripped, and
:: then the path is enclosed in double quotes if and only if the path
:: contains at least one semicolon.
::
:: addPath aborts with ERRORLEVEL 2 if pathVar is missing or undefined
:: or if PATH is undefined.
::
::------------------------------------------------------------------------
::
:: Error checking
if "%~1"=="" exit /b 2
if not defined %~1 exit /b 2
if not defined path exit /b 2
::
:: Determine if function was called while delayed expansion was enabled
setlocal
set "NotDelayed=!"
::
:: Prepare to safely parse PATH into individual paths
setlocal DisableDelayedExpansion
set "var=%path:"=""%"
set "var=%var:^=^^%"
set "var=%var:&=^&%"
set "var=%var:|=^|%"
set "var=%var:<=^<%"
set "var=%var:>=^>%"
set "var=%var:;=^;^;%"
set var=%var:""="%
set "var=%var:"=""Q%"
set "var=%var:;;="S"S%"
set "var=%var:^;^;=;%"
set "var=%var:""="%"
setlocal EnableDelayedExpansion
set "var=!var:"Q=!"
set "var=!var:"S"S=";"!"
::
:: Remove quotes from pathVar and abort if it becomes empty
set "new=!%~1:"^=!"
if not defined new exit /b 2
::
:: Determine if pathVar is fully qualified
echo("!new!"|findstr /i /r /c:^"^^\"[a-zA-Z]:[\\/][^\\/]" ^
/c:^"^^\"[\\][\\]" >nul ^
&& set "abs=1" || set "abs=0"
::
:: For each path in PATH, check if path is fully qualified and then
:: do proper comparison with pathVar. Exit if a match is found.
:: Delayed expansion must be disabled when expanding FOR variables
:: just in case the value contains !
for %%A in ("!new!\") do for %%B in ("!var!") do (
if "!!"=="" setlocal disableDelayedExpansion
for %%C in ("%%~B\") do (
echo(%%B|findstr /i /r /c:^"^^\"[a-zA-Z]:[\\/][^\\/]" ^
/c:^"^^\"[\\][\\]" >nul ^
&& (if %abs%==1 if /i "%%~sA"=="%%~sC" exit /b 0) ^
|| (if %abs%==0 if /i %%A==%%C exit /b 0)
)
)
::
:: Build the modified PATH, enclosing the added path in quotes
:: only if it contains ;
setlocal enableDelayedExpansion
if "!new:;=!" neq "!new!" set new="!new!"
if /i "%~2"=="/B" (set "rtn=!new!;!path!") else set "rtn=!path!;!new!"
::
:: rtn now contains the modified PATH. We need to safely pass the
:: value accross the ENDLOCAL barrier
::
:: Make rtn safe for assignment using normal expansion by replacing
:: % and " with not yet defined FOR variables
set "rtn=!rtn:%%=%%A!"
set "rtn=!rtn:"=%%B!"
::
:: Escape ^ and ! if function was called while delayed expansion was enabled.
:: The trailing ! in the second assignment is critical and must not be removed.
if not defined NotDelayed set "rtn=!rtn:^=^^^^!"
if not defined NotDelayed set "rtn=%rtn:!=^^^!%" !
::
:: Pass the rtn value accross the ENDLOCAL barrier using FOR variables to
:: restore the % and " characters. Again the trailing ! is critical.
for /f "usebackq tokens=1,2" %%A in ('%%^ ^"') do (
endlocal & endlocal & endlocal & endlocal & endlocal
set "path=%rtn%" !
)
exit /b 0
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
@echo off
:inPath pathVar
::
:: Tests if the path stored within variable pathVar exists within PATH.
::
:: The result is returned as the ERRORLEVEL:
:: 0 if the pathVar path is found in PATH.
:: 1 if the pathVar path is not found in PATH.
:: 2 if pathVar is missing or undefined or if PATH is undefined.
::
:: If the pathVar path is fully qualified, then it is logically compared
:: to each fully qualified path within PATH. The path strings don't have
:: to match exactly, they just need to be logically equivalent.
::
:: If the pathVar path is relative, then it is strictly compared to each
:: relative path within PATH. Case differences and double quotes are
:: ignored, but otherwise the path strings must match exactly.
::
::------------------------------------------------------------------------
::
:: Error checking
if "%~1"=="" exit /b 2
if not defined %~1 exit /b 2
if not defined path exit /b 2
::
:: Prepare to safely parse PATH into individual paths
setlocal DisableDelayedExpansion
set "var=%path:"=""%"
set "var=%var:^=^^%"
set "var=%var:&=^&%"
set "var=%var:|=^|%"
set "var=%var:<=^<%"
set "var=%var:>=^>%"
set "var=%var:;=^;^;%"
set var=%var:""="%
set "var=%var:"=""Q%"
set "var=%var:;;="S"S%"
set "var=%var:^;^;=;%"
set "var=%var:""="%"
setlocal EnableDelayedExpansion
set "var=!var:"Q=!"
set "var=!var:"S"S=";"!"
::
:: Remove quotes from pathVar and abort if it becomes empty
set "new=!%~1:"=!"
if not defined new exit /b 2
::
:: Determine if pathVar is fully qualified
echo("!new!"|findstr /i /r /c:^"^^\"[a-zA-Z]:[\\/][^\\/]" ^
/c:^"^^\"[\\][\\]" >nul ^
&& set "abs=1" || set "abs=0"
::
:: For each path in PATH, check if path is fully qualified and then do
:: proper comparison with pathVar.
:: Exit with ERRORLEVEL 0 if a match is found.
:: Delayed expansion must be disabled when expanding FOR variables
:: just in case the value contains !
for %%A in ("!new!\") do for %%B in ("!var!") do (
if "!!"=="" endlocal
for %%C in ("%%~B\") do (
echo(%%B|findstr /i /r /c:^"^^\"[a-zA-Z]:[\\/][^\\/]" ^
/c:^"^^\"[\\][\\]" >nul ^
&& (if %abs%==1 if /i "%%~sA"=="%%~sC" exit /b 0) ^
|| (if %abs%==0 if /i "%%~A"=="%%~C" exit /b 0)
)
)
:: No match was found so exit with ERRORLEVEL 1
exit /b 1
\ No newline at end of file
@echo off
cls
setLocal EnableDelayedExpansion
rem Get the running directory for later ease of use
SET running_directory=%~dp0
rem Set where this file will install the rest of the files
SET "install_location=%APPDATA%\CIRCLE"
rem Set whether we want output info on screen or not
IF NOT "%1"=="" (
SET "output_on_screen=%1"
) else (
SET "output_on_screen=False"
)
rem Set whether we want to install selenium or not
IF NOT "%2"=="" (
SET "install_selenium=%2"
) else (
SET "install_selenium=False"
)
rem Set which website should the icon point to
SET "website="
IF NOT "%3"=="" (
IF "%install_selenium%"=="False" (
SET site=%3
SET my_site=!site:"=!
SET "website= -t ^"!my_site!^""
)
)
:BatchCheckElevated
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
set vbs_site=!site:"=""!
echo UAC.ShellExecute "cmd.exe", "/c %~s0 !output_on_screen! !install_selenium! !vbs_site!", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
del "%temp%\getadmin.vbs"
exit /B
:gotAdmin
pushd "%CD%"
CD /D "%~dp0"
IF NOT "!output_on_screen!"=="False" (
@echo Elevated rights recived from UAC
)
:--------------------------------------
rem Start the installation script
IF NOT "!output_on_screen!"=="False" (
@echo Starting CIRCLE Client install script
@echo.
)
call :SUB_ARCHITECTURE architecture
rem Decide whether python 2.x is installed or not
SET "python_registry="
:PYTHON_CHECK
SET index=8
:loop
SET /a index-=1
IF %index% LSS 6 (
if "!architecture!"=="64" (
if "%python_registry%"=="" (
SET "python_registry=Wow6432Node\"
GOTO PYTHON_CHECK
) else (
GOTO NOPYTHON
)
) else (
GOTO NOPYTHON
)
)
SET version=2.%index%
SET @query="hklm\SOFTWARE\%python_registry%Python\PythonCore\%version%"
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
:NOPYTHON
IF NOT "!output_on_screen!"=="False" (
@echo No 2.6^+ Python is detected on the system.
)
if "!architecture!"=="64" (
IF NOT "!output_on_screen!"=="False" (
@echo 64 bit system detected, commencing the install
)
start /WAIT %running_directory%x64^\python-2.7.7.amd64.msi
GOTO NOWHASPYTHON
)
if "!architecture!"=="32" (
IF NOT "!output_on_screen!"=="False" (
@echo 32 bit system detected, commencing the install
)
start /WAIT %running_directory%x86^\python-2.7.7.msi
GOTO NOWHASPYTHON
)
GOTO ERR
rem Subroutine to decide whether it is 32 or 64 bit
:SUB_ARCHITECTURE
rem Decide what architecture the system is using
if /i "%processor_architecture%"=="AMD64" (
SET %1=64
GOTO END
)
if /i "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
SET %1=64
GOTO END
)
if /i "%processor_architecture%"=="x86" (
SET %1=32
GOTO END
)
GOTO ERR
rem Error within the installation
:ERR
IF NOT "!output_on_screen!"=="False" (
@echo Unsupported architecture! Please install files manually
@echo Please visit: https://www.python.org/downloads/
@echo Please visit: http://www.mozilla.org/en/firefox/new/
pause
)
GOTO END
rem The install program closed. Check whether the Python installation was successful
:NOWHASPYTHON
SET version=2.7
IF NOT "!output_on_screen!"=="False" (
@echo Python install finished, rechecking registry
)
GOTO UACPrompt
rem We have Python but let's check if it's in the PATH
:HASPYTHON
IF NOT "!output_on_screen!"=="False" (
@echo %version% Python is found, checking PATH variable
)
rem Check Python install path
set install_path=
for /f "tokens=2,*" %%a in ('reg query "hklm\SOFTWARE\%python_registry%Python\PythonCore\%version%\InstallPath"') do (
set install_path=%%b
)
rem Check whether python.exe is in the install path (python uninstall doesn't delete registry entrys)
if NOT EXIST "%install_path%python.exe" (
IF NOT "!output_on_screen!"=="False" (
@echo %version% Python was installed but it is NOT now. Restarting the search for python^^!
)
goto loop
) else (
set test=%install_path:~0,-1%
call %running_directory%inPath test && (IF NOT "!output_on_screen!"=="False" (@echo %test% is already in PATH)) || (call %running_directory%addPath test & setx>nul PATH "%PATH%;%test%" /m & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to PATH))
set test=%install_path%Scripts
call %running_directory%inPath test && (IF NOT "!output_on_screen!"=="False" (@echo %test% is already in PATH)) || (call %running_directory%addPath test & setx>nul PATH "%PATH%;%test%" /m & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to PATH))
)
GOTO PIP_CHECK
rem Check whether PIP is installed or not
:PIP_CHECK
IF NOT "!output_on_screen!"=="False" (
@echo.
@echo Checking if PIP is installed
)
IF EXIST %install_path%Scripts/PIP.exe GOTO PIP_VERSION_CHECK
IF NOT "!output_on_screen!"=="False" (
@echo No PIP found, commencing PIP install
)
IF NOT "!output_on_screen!"=="False" (
call python %running_directory%get-pip.py
) else (
call python %running_directory%get-pip.py >nul 2>&1
)
rem Try to update the PIP
:PIP_VERSION_CHECK
IF NOT "!output_on_screen!"=="False" (
@echo PIP is found
@echo Checking whether the latest PIP is installed
)
IF NOT "!output_on_screen!"=="False" (
call python -m pip install --upgrade pip
) else (
call python -m pip install --upgrade pip >nul 2>&1
)
SET "pip_program=requirements.txt"
IF NOT "!output_on_screen!"=="False" (
@echo Installing python modules
)
GOTO PIP_PACKAGE_INSTALL
rem Check if the PIP package is installed or not
:PIP_PACKAGE_CHECK
IF NOT "!output_on_screen!"=="False" (
@echo.
@echo Check whether !pip_program! is installed
)
for /f "tokens=1,2 delims===" %%a in ('call python -m pip freeze') do (
if "%%a"=="!pip_program!" (
IF NOT "!output_on_screen!"=="False" (
@echo %%b !pip_program! is found
)
GOTO CHECK_PACKAGE_LIST
)
)
IF NOT "!output_on_screen!"=="False" (
@echo No !pip_program! version is found, commencing install
)
GOTO PIP_PACKAGE_INSTALL
rem Try to install the PIP packages via PIP
:PIP_PACKAGE_INSTALL
if "!pip_program!"=="pywin32" (
call python %running_directory%pywin_installer.py
) else (
IF NOT "!output_on_screen!"=="False" (
call python -m pip install -r requirements.txt
) else (
call python -m pip install -r requirements.txt >nul 2>&1
)
)
goto CHECK_PACKAGE_LIST
:CHECK_PACKAGE_LIST
if "!pip_program!"=="requirements.txt" (
set "pip_program=pywin32"
goto PIP_PACKAGE_CHECK
)
if NOT "%install_selenium%"=="False" (
goto CHECK_BROWSER
) else (
goto FIN
)
rem Get installed browsers
:CHECK_BROWSER
set browserToUse=None
IF NOT "!output_on_screen!"=="False" (
@echo.
@echo Checking installed browsers
)
rem For 64 bit systems
START /W REGEDIT /E "%Temp%\BROW3.reg" HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\StartMenuInternet
rem For 32 bit systems
if not exist "%Temp%\BROW3.reg" START /W REGEDIT /E "%Temp%\BROW3.reg" HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet
set count=1
for /f "tokens=*" %%B in ('type "%Temp%\BROW3.reg" ^| findstr /E "DefaultIcon]"') do (
rem Extracting browser name from icon path
set "browser=%%B"
rem Removing \DefaultIcon] string
set "browser=!browser:\DefaultIcon]=!"
rem Get the browser name
for %%P in ("!browser!") do (
call :SUB_PRINTBROWSER %%~nP
)
)
GOTO CHECK_BROWSER_TO_USE
rem Subroutine to print installed browsers
:SUB_PRINTBROWSER
set subBrowser=%*
CALL :UCase subBrowser upperBrowser
if "%upperBrowser%"=="FIREFOX" (
IF NOT "!output_on_screen!"=="False" (
@echo !count!. %upperBrowser% ^(Recommended^) ^- will be used
)
if NOT "%install_selenium%"=="False" (
SET "browserToUse=firefox"
)
) else (
IF NOT "!output_on_screen!"=="False" (
@echo !count!. %upperBrowser%
)
)
set /a count+=1
GOTO END
rem Determine which Selenium driver to use
:CHECK_BROWSER_TO_USE
if "!browserToUse!"=="None" (
IF NOT "!output_on_screen!"=="False" (
@echo Decide whitch browser to use
@echo Checking which one is the Default browser
)
START /W REGEDIT /E "%Temp%\BROW5.reg" HKEY_CLASSES_ROOT\http\shell\open\command
for /f tokens^=3^ delims^=^" %%B in ('type "%Temp%\BROW5.reg" ^| find "@"') do (
set "default=%%B"
rem removing double slashes
set "default=!default:\\=\!"
rem removing end slash
set "default=!default:~0,-1!"
rem get the name
for %%D in ("!default!") do (
call :SUB_DEFAULTBROWSER %%~nD
)
)
del /Q /F "%Temp%\BROW5.reg"
)
) else (
rem Registry location depends of the architecture
if "!architecture!"=="64" (
set "browser_architect=Wow6432Node\"
set "architecture_name=x64"
) else (
if "!architecture!"=="32" (
set "browser_architect="
set "architecture_name=x86"
) else (
GOTO ERR
)
)
rem Registry names for the different browsers out there
if "!browserToUse!"=="firefox" (
set "browser_path_name=FIREFOX.EXE"
set "selenium_driver_name="
)
if "!browserToUse!"=="chrome" (
set "browser_path_name=Google Chrome"
set "selenium_driver_name=chromedriver.exe"
)
if "!browserToUse!"=="iexplore" (
set "browser_path_name=IEXPLORE.EXE"
set "selenium_driver_name=IEDriverServer.exe"
)
rem Opera have to versions (in the registry) Opera and OperaStable, we try to Stable first
if "!browserToUse!"=="opera" (
set "browser_path_name=OperaStable"
set "selenium_driver_name="
)
set "browser_path="
IF NOT "!output_on_screen!"=="False" (
@echo Check if !browserToUse!.exe is in PATH
)
:get_browser_path
set browser_path=
set query="hklm\SOFTWARE\%browser_architect%Clients\StartMenuInternet\%browser_path_name%\shell\open\command"
reg>nul query %query% 2>nul
if ERRORLEVEL 1 (
if "%browser_path%"=="" (
if "%browser_architect%"=="" (
rem If the Stable failed check out the simple Opera
if "%browser_path_name%"=="OperaStable" (
SET "browser_path_name=Opera"
SET "browser_architect=Wow6432Node\"
goto get_browser_path
)
IF NOT "!output_on_screen!"=="False" (
@echo Location not found^^! Please add !browserToUse!.exe to PATH manually
pause
)
goto install_driver
) else (
set "browser_architect="
goto get_browser_path
)
)
)
rem Get the installation path for the selected browser
for /f "tokens=2,*" %%a in ('reg query %query%') do (
set browser_path=%%b
)
set browser_path=%browser_path:"=%
call :Split "%browser_path%" test
set myTest=!test:~0,-1!
rem Set that path in the PATH environment variable
call %running_directory%inPath myTest && (IF NOT "!output_on_screen!"=="False" ( @echo !myTest! is already in PATH)) || (call %running_directory%addPath myTest & setx>nul PATH "%PATH%;!myTest!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !myTest! set to PATH) )
:install_driver
IF NOT "%install_selenium%"=="False" (
if NOT "!selenium_driver_name!"=="" (
@echo Installing the !browserToUse! Selenium driver
xcopy>nul "%running_directory%%architecture_name%^\%selenium_driver_name%" "!install_location!\" /y
if ERRORLEVEL 0 (
IF NOT "!output_on_screen!"=="False" (
@echo Done
)
) else (
IF NOT "!output_on_screen!"=="False" (
@echo Error^^! Please copy the ^'chromedriver.exe^' to ^'!install_location!^\^' manually
)
)
)
rem For the Opera we need to install the selenium standalone jar
if "!browserToUse!"=="opera" (
SET "standalone_version=selenium-server-standalone-2.42.2.jar"
IF NOT "!output_on_screen!"=="False" (
@echo Installing the Selenium server stand alone JAR
)
xcopy>nul "%running_directory%!standalone_version!" "!install_location!\"
if ERRORLEVEL 0 (
IF NOT "!output_on_screen!"=="False" (
@echo Done
)
rem And set it in the SELENIUM_SERVER_JAR environment variable
IF NOT "!output_on_screen!"=="False" (
@echo Setting the SELENIUM_SERVER_JAR environment variable
)
setx>nul SELENIUM_SERVER_JAR "!install_location!^\!standalone_version!"
IF NOT "!output_on_screen!"=="False" (
@echo local SELENIUM_SERVER_JAR set to ^'!install_location!^\!standalone_version!^'
)
) else (
IF NOT "!output_on_screen!"=="False" (
@echo Error^^! Please copy the ^'%standalone_version%^' to ^'!test!^' manually
)
)
)
)
GOTO FIN
)
GOTO ERR
rem Finish up the install
:FIN
rem Create folder if needed and set it to PATH
IF NOT "!output_on_screen!"=="False" (
@echo Checking wheter ^'%install_location%^\^' exists already
)
call %running_directory%inPath install_location && (IF NOT "!output_on_screen!"=="False" ( @echo !install_location! is already in PATH)) || (call %running_directory%addPath install_location & setx>nul PATH "%PATH%;!install_location!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !install_location! set to PATH))
if not exist "%install_location%\" (
mkdir "%install_location%"
)
if not exist "%install_location%\.rdp\" (
mkdir "%install_location%\.rdp"
)
rem Copy the files to the folder
IF NOT "!output_on_screen!"=="False" (
@echo Copying files to ^'%install_location%^'
)
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%windowsclasses.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
xcopy>nul "%running_directory%putty.exe" "%install_location%\" /y
IF NOT "!output_on_screen!"=="False" (
@echo Done
@echo.
)
IF "%install_selenium%"=="False" (
SET "create_url_icon= -u"
) else (
SET "create_url_icon="
)
IF NOT "!output_on_screen!"=="False" (
@echo Starting the python installation script
)
if NOT "!browserToUse!"=="" (
SET "selenium_driver= -d !browserToUse!"
)
IF NOT "!output_on_screen!"=="False" (
call python %running_directory%win_install.py!selenium_driver! ^-l "%install_location%\\"!create_url_icon!!website!
) else (
call python %running_directory%win_install.py!selenium_driver! ^-l "%install_location%\\"!create_url_icon!!website! >nul 2>&1
)
IF NOT "!output_on_screen!"=="False" (
@echo Done
@echo Installation complete
)
GOTO END
rem Subroutine to decide which Selenium driver to use
:SUB_DEFAULTBROWSER
set defBrowser=%*
CALL :LCase defBrowser lowerFound
if "%lowerFound%"=="launcher" (
set "lowerFound=opera"
)
IF NOT "!output_on_screen!"=="False" (
@echo %lowerFound% is the default browser
)
set browserToUse=%lowerFound%
GOTO END
:LCase
:UCase
:: Converts to upper/lower case variable contents
:: Syntax: CALL :UCase _VAR1 _VAR2
:: Syntax: CALL :LCase _VAR1 _VAR2
:: _VAR1 = Variable NAME whose VALUE is to be converted to upper/lower case
:: _VAR2 = NAME of variable to hold the converted value
:: Note: Use variable NAMES in the CALL, not values (pass "by reference")
SET _UCase=A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
SET _LCase=a b c d e f g h i j k l m n o p q r s t u v w x y z
SET _Lib_UCase_Tmp=!%1!
IF /I "%0"==":UCase" SET _Abet=%_UCase%
IF /I "%0"==":LCase" SET _Abet=%_LCase%
FOR %%Z IN (%_Abet%) DO SET _Lib_UCase_Tmp=!_Lib_UCase_Tmp:%%Z=%%Z!
SET %2=%_Lib_UCase_Tmp%
GOTO END
rem Subroutine to get the exact path out from a file location, but strip the file name
:Split
SET %2=%~dp1
GOTO END
:END
\ No newline at end of file
;NSIS Modern User Interface
;Multilingual Cloud Installer Script
;Written by Csk Tams
;--------------------------------
;Include Modules
!include "MUI2.nsh"
!include "LogicLib.nsh"
!include "x64.nsh"
;--------------------------------
;Defining new constants
!define Company "CIRCLE Cloud"
!define AppName "Client"
!define AppUrlName "BME CIRCLE"
!define AppUrl "http://cloud.bme.hu/"
!define AppUninstaller "Uninstall.exe"
!define IconName "cloud"
!define Show_output "True"
!define Install_selenium "False"
;--------------------------------
;General
;Properly display all languages (Installer will not work on Windows 95, 98 or ME!)
Unicode true
;Name and file
Name "${Company} ${AppName}"
OutFile "..\..\dist\CIRCLE_Client_Setup.exe"
;Disable to skip files from installing
AllowSkipFiles off
;If there are existing files stored try to overwrite it
SetOverwrite try
;Default installation folder
InstallDir "$LOCALAPPDATA\CIRCLE"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\${Company} ${AppName}" ""
;Request application privileges
RequestExecutionLevel admin
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${IconName}.ico"
!define MUI_UNICON "${IconName}.ico"
;Show all languages, despite user's codepage
!define MUI_LANGDLL_ALLLANGUAGES
;--------------------------------
;Language Selection Dialog Settings
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\${Company} ${AppName}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "gpl-3.0.txt"
!insertmacro MUI_PAGE_INSTFILES
;Done fuction to launch install.bat
!define MUI_PAGE_CUSTOMFUNCTION_PRE Done
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English" ;first language is the default language
!insertmacro MUI_LANGUAGE "Hungarian"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Spanish"
!insertmacro MUI_LANGUAGE "SpanishInternational"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_LANGUAGE "TradChinese"
!insertmacro MUI_LANGUAGE "Japanese"
!insertmacro MUI_LANGUAGE "Korean"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Swedish"
!insertmacro MUI_LANGUAGE "Norwegian"
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
!insertmacro MUI_LANGUAGE "Finnish"
!insertmacro MUI_LANGUAGE "Greek"
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "Portuguese"
!insertmacro MUI_LANGUAGE "PortugueseBR"
!insertmacro MUI_LANGUAGE "Polish"
!insertmacro MUI_LANGUAGE "Ukrainian"
!insertmacro MUI_LANGUAGE "Czech"
!insertmacro MUI_LANGUAGE "Slovak"
!insertmacro MUI_LANGUAGE "Croatian"
!insertmacro MUI_LANGUAGE "Bulgarian"
!insertmacro MUI_LANGUAGE "Thai"
!insertmacro MUI_LANGUAGE "Romanian"
!insertmacro MUI_LANGUAGE "Latvian"
!insertmacro MUI_LANGUAGE "Macedonian"
!insertmacro MUI_LANGUAGE "Estonian"
!insertmacro MUI_LANGUAGE "Turkish"
!insertmacro MUI_LANGUAGE "Lithuanian"
!insertmacro MUI_LANGUAGE "Slovenian"
!insertmacro MUI_LANGUAGE "Serbian"
!insertmacro MUI_LANGUAGE "SerbianLatin"
!insertmacro MUI_LANGUAGE "Arabic"
!insertmacro MUI_LANGUAGE "Farsi"
!insertmacro MUI_LANGUAGE "Hebrew"
!insertmacro MUI_LANGUAGE "Indonesian"
!insertmacro MUI_LANGUAGE "Mongolian"
!insertmacro MUI_LANGUAGE "Luxembourgish"
!insertmacro MUI_LANGUAGE "Albanian"
!insertmacro MUI_LANGUAGE "Breton"
!insertmacro MUI_LANGUAGE "Belarusian"
!insertmacro MUI_LANGUAGE "Icelandic"
!insertmacro MUI_LANGUAGE "Malay"
!insertmacro MUI_LANGUAGE "Bosnian"
!insertmacro MUI_LANGUAGE "Kurdish"
!insertmacro MUI_LANGUAGE "Irish"
!insertmacro MUI_LANGUAGE "Uzbek"
!insertmacro MUI_LANGUAGE "Galician"
!insertmacro MUI_LANGUAGE "Afrikaans"
!insertmacro MUI_LANGUAGE "Catalan"
!insertmacro MUI_LANGUAGE "Esperanto"
!insertmacro MUI_LANGUAGE "Asturian"
!insertmacro MUI_LANGUAGE "Pashto"
;!insertmacro MUI_LANGUAGE "ScotsGaelic"
!ifdef NSIS_UNICODE
!insertmacro MUI_LANGUAGE "Georgian"
!endif
;--------------------------------
;Reserve Files
!insertmacro MUI_RESERVEFILE_LANGDLL
;--------------------------------
;Installer Sections
Section "Install Section" SecInstall
SetOutPath "$INSTDIR"
;ADD OWN FILES HERE----------------------------------------
File /r installer
File /r uninstaller
;Store installation folder
WriteRegStr HKCU "Software\${Company} ${AppName}" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\${AppUninstaller}"
;Creating ShortCuts
CreateDirectory '$SMPROGRAMS\${Company}\${AppName}'
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +3
WriteINIStr "$SMPROGRAMS\${Company}\Ltogasd meg a ${AppUrlName}-t.url" "InternetShortcut" "URL" "${AppUrl}"
Goto +2
WriteINIStr "$SMPROGRAMS\${Company}\Visit the ${AppUrlName}.url" "InternetShortcut" "URL" "${AppUrl}"
CreateShortCut '$SMPROGRAMS\${Company}\${AppName}\Uninstall ${AppName}.lnk' '$INSTDIR\${AppUninstaller}' "" '$INSTDIR\${AppUninstaller}' 0
SectionEnd
;--------------------------------
;Installer Functions
Function .onInit
${If} ${RunningX64}
${DisableX64FSRedirection}
SetRegView 64
${EndIf}
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
Function Done
ExecWait '"$INSTDIR\installer\install.cmd" ${Show_output} ${Install_selenium} "${AppUrl}"'
RMDir /r "$INSTDIR\installer"
FunctionEnd
;--------------------------------
;Descriptions
;USE A LANGUAGE STRING IF YOU WANT YOUR DESCRIPTIONS TO BE LANGAUGE SPECIFIC
;Assign descriptions to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +3
!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} "A ${AppName} installlsa"
Goto +2
!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} "Installing the ${AppName}"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
;--------------------------------
;Uninstaller Section
Section "Uninstall"
ExecWait '"$INSTDIR\uninstaller\uninstall.cmd" ${Show_output}'
Delete "$INSTDIR\${AppUninstaller}"
StrCmp $LANGUAGE ${LANG_HUNGARIAN} 0 +3
Delete "$SMPROGRAMS\${Company}\Ltogasd meg a ${AppUrlName}-t.url"
Goto +2
Delete "$SMPROGRAMS\${Company}\Visit the ${AppUrlName}.url"
RMDir /r "$INSTDIR"
RMDir /r "$SMPROGRAMS\${Company}\${AppName}"
DeleteRegKey /ifempty HKCU "Software\${Company} ${AppName}"
SectionEnd
;--------------------------------
;Uninstaller Functions
Function un.onInit
${If} ${RunningX64}
${DisableX64FSRedirection}
SetRegView 64
${EndIf}
!insertmacro MUI_UNGETLANGUAGE
FunctionEnd
\ No newline at end of file
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
......@@ -18,7 +18,7 @@ IF NOT "%2"=="" (
SET "install_selenium=False"
)
rem Set which website should the icon point to
SET "website="
SET "site=^"http://cloud.bme.hu/^""
IF NOT "%3"=="" (
IF "%install_selenium%"=="False" (
SET site=%3
......@@ -39,11 +39,11 @@ if '%errorlevel%' NEQ '0' (
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo Set UAC = CreateObject^("Shell.Application"^) > ^"%temp%\getadmin.vbs^"
set vbs_site=!site:"=""!
echo UAC.ShellExecute "cmd.exe", "/c %~s0 !output_on_screen! !install_selenium! !vbs_site!", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
^"%temp%\getadmin.vbs^"
del "%temp%\getadmin.vbs"
exit /B
......@@ -97,14 +97,14 @@ IF NOT "!output_on_screen!"=="False" (
IF NOT "!output_on_screen!"=="False" (
@echo 64 bit system detected, commencing the install
)
start /WAIT %running_directory%x64^\python-2.7.7.amd64.msi
start /WAIT ^"%running_directory%x64^\python-2.7.7.amd64.msi^"
GOTO NOWHASPYTHON
)
if "!architecture!"=="32" (
IF NOT "!output_on_screen!"=="False" (
@echo 32 bit system detected, commencing the install
)
start /WAIT %running_directory%x86^\python-2.7.7.msi
start /WAIT ^"%running_directory%x86^\python-2.7.7.msi^"
GOTO NOWHASPYTHON
)
GOTO ERR
......@@ -162,38 +162,21 @@ IF NOT "!output_on_screen!"=="False" (
goto loop
) else (
set test=%install_path:~0,-1%
call %running_directory%inPath test && (IF NOT "!output_on_screen!"=="False" (@echo %test% is already in PATH)) || (call %running_directory%addPath test & setx>nul PATH "%PATH%;%test%" /m & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to PATH))
call ^"%running_directory%inPath^" ^"test^" && (IF NOT "!output_on_screen!"=="False" (@echo %test% is already in PATH)) || (call ^"%running_directory%addPath^" ^"test^" & setx>nul PATH "%PATH%;%test%" /m & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to PATH))
set test=%install_path%Scripts
call %running_directory%inPath test && (IF NOT "!output_on_screen!"=="False" (@echo %test% is already in PATH)) || (call %running_directory%addPath test & setx>nul PATH "%PATH%;%test%" /m & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to PATH))
call ^"%running_directory%inPath^" ^"test^" && (IF NOT "!output_on_screen!"=="False" (@echo %test% is already in PATH)) || (call ^"%running_directory%addPath^" ^"test^" & setx>nul PATH "%PATH%;%test%" /m & IF NOT "!output_on_screen!"=="False" ( @echo %test% set to PATH))
)
GOTO PIP_CHECK
GOTO PIP_INSTALL
rem Check whether PIP is installed or not
:PIP_CHECK
:PIP_INSTALL
IF NOT "!output_on_screen!"=="False" (
@echo.
@echo Checking if PIP is installed
)
IF EXIST %install_path%Scripts/PIP.exe GOTO PIP_VERSION_CHECK
IF NOT "!output_on_screen!"=="False" (
@echo No PIP found, commencing PIP install
)
IF NOT "!output_on_screen!"=="False" (
call python %running_directory%get-pip.py
) else (
call python %running_directory%get-pip.py >nul 2>&1
)
rem Try to update the PIP
:PIP_VERSION_CHECK
IF NOT "!output_on_screen!"=="False" (
@echo PIP is found
@echo Checking whether the latest PIP is installed
@echo Commencing PIP reinstall to solve compatibility issues
)
IF NOT "!output_on_screen!"=="False" (
call python -m pip install --upgrade pip
CALL easy_install pip
) else (
call python -m pip install --upgrade pip >nul 2>&1
CALL easy_install pip >nul 2>&1
)
SET "pip_program=requirements.txt"
IF NOT "!output_on_screen!"=="False" (
......@@ -375,7 +358,7 @@ if "!browserToUse!"=="None" (
call :Split "%browser_path%" test
set myTest=!test:~0,-1!
rem Set that path in the PATH environment variable
call %running_directory%inPath myTest && (IF NOT "!output_on_screen!"=="False" ( @echo !myTest! is already in PATH)) || (call %running_directory%addPath myTest & setx>nul PATH "%PATH%;!myTest!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !myTest! set to PATH) )
call ^"%running_directory%inPath^" ^"myTest^" && (IF NOT "!output_on_screen!"=="False" ( @echo !myTest! is already in PATH)) || (call ^"%running_directory%addPath^" ^"myTest^" & setx>nul PATH "%PATH%;!myTest!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !myTest! set to PATH) )
:install_driver
IF NOT "%install_selenium%"=="False" (
if NOT "!selenium_driver_name!"=="" (
......@@ -428,12 +411,12 @@ rem Create folder if needed and set it to PATH
IF NOT "!output_on_screen!"=="False" (
@echo Checking wheter ^'%install_location%^\^' exists already
)
call %running_directory%inPath install_location && (IF NOT "!output_on_screen!"=="False" ( @echo !install_location! is already in PATH)) || (call %running_directory%addPath install_location & setx>nul PATH "%PATH%;!install_location!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !install_location! set to PATH))
call ^"%running_directory%inPath^" ^"install_location^" && (IF NOT "!output_on_screen!"=="False" ( @echo !install_location! is already in PATH)) || (call ^"%running_directory%addPath^" ^"install_location^" & setx>nul PATH "%PATH%;!install_location!" /m & IF NOT "!output_on_screen!"=="False" ( @echo !install_location! set to PATH))
if not exist "%install_location%\" (
mkdir "%install_location%"
mkdir ^"%install_location%^"
)
if not exist "%install_location%\.rdp\" (
mkdir "%install_location%\.rdp"
mkdir ^"%install_location%\.rdp^"
)
rem Copy the files to the folder
IF NOT "!output_on_screen!"=="False" (
......@@ -463,9 +446,9 @@ if NOT "!browserToUse!"=="" (
SET "selenium_driver= -d !browserToUse!"
)
IF NOT "!output_on_screen!"=="False" (
call python %running_directory%win_install.py!selenium_driver! ^-l "%install_location%\\"!create_url_icon!!website!
call python ^"%running_directory%win_install.py!selenium_driver!^" ^-l "%install_location%\\"!create_url_icon!!website!
) else (
call python %running_directory%win_install.py!selenium_driver! ^-l "%install_location%\\"!create_url_icon!!website! >nul 2>&1
call python ^"%running_directory%win_install.py!selenium_driver!^" ^-l "%install_location%\\"!create_url_icon!!website! >nul 2>&1
)
IF NOT "!output_on_screen!"=="False" (
@echo Done
......
......@@ -102,7 +102,7 @@ def main():
desktop_path = shell.SHGetFolderPath(
0, shellcon.CSIDL_DESKTOP, 0, 0)
if args.remove:
location = os.path.join(desktop_path, "Cloud GUI")
location = os.path.join(desktop_path, "CIRCLE Client")
if os.path.isfile("%s%s" % (location, ".lnk")):
os.remove("%s%s" % (location, ".lnk"))
if os.path.isfile("%s%s" % (location, ".url")):
......@@ -112,7 +112,7 @@ def main():
"python %s\\nx_client_installer.py" % os.path.dirname(
os.path.realpath(__file__)))
if args.url:
location = os.path.join(desktop_path, "Cloud GUI.url")
location = os.path.join(desktop_path, "CIRCLE Client.url")
shortcut = file(location, 'w')
shortcut.write('[InternetShortcut]\n')
shortcut.write('URL='+args.target)
......@@ -131,7 +131,7 @@ def main():
0, shellcon.CSIDL_DESKTOP, 0, 0)
persist_file = shortcut.QueryInterface(
pythoncom.IID_IPersistFile)
location = os.path.join(desktop_path, "Cloud GUI.lnk")
location = os.path.join(desktop_path, "CIRCLE Client.lnk")
persist_file.Save(location, 0)
print "Icon successfully created on desktop"
shutil.copy(location, args.location)
......
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# flake8: noqa
try:
from thread import get_ident as _get_ident
except ImportError:
from dummy_thread import get_ident as _get_ident
try:
from _abcoll import KeysView, ValuesView, ItemsView
except ImportError:
pass
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps keys to values.
# The inherited dict provides __getitem__, __len__, __contains__, and get.
# The remaining methods are order-aware.
# Big-O running times for all methods are the same as for regular dictionaries.
# The internal self.__map dictionary maps keys to links in a doubly linked list.
# The circular doubly linked list starts and ends with a sentinel element.
# The sentinel element never gets deleted (this simplifies the algorithm).
# Each link is stored as a list of length three: [PREV, NEXT, KEY].
def __init__(self, *args, **kwds):
'''Initialize an ordered dictionary. Signature is the same as for
regular dictionaries, but keyword arguments are not recommended
because their insertion order is arbitrary.
'''
if len(args) > 1:
raise TypeError('expected at most 1 arguments, got %d' % len(args))
try:
self.__root
except AttributeError:
self.__root = root = [] # sentinel node
root[:] = [root, root, None]
self.__map = {}
self.__update(*args, **kwds)
def __setitem__(self, key, value, dict_setitem=dict.__setitem__):
'od.__setitem__(i, y) <==> od[i]=y'
# Setting a new item creates a new link which goes at the end of the linked
# list, and the inherited dictionary is updated with the new key/value pair.
if key not in self:
root = self.__root
last = root[0]
last[1] = root[0] = self.__map[key] = [last, root, key]
dict_setitem(self, key, value)
def __delitem__(self, key, dict_delitem=dict.__delitem__):
'od.__delitem__(y) <==> del od[y]'
# Deleting an existing item uses self.__map to find the link which is
# then removed by updating the links in the predecessor and successor nodes.
dict_delitem(self, key)
link_prev, link_next, key = self.__map.pop(key)
link_prev[1] = link_next
link_next[0] = link_prev
def __iter__(self):
'od.__iter__() <==> iter(od)'
root = self.__root
curr = root[1]
while curr is not root:
yield curr[2]
curr = curr[1]
def __reversed__(self):
'od.__reversed__() <==> reversed(od)'
root = self.__root
curr = root[0]
while curr is not root:
yield curr[2]
curr = curr[0]
def clear(self):
'od.clear() -> None. Remove all items from od.'
try:
for node in self.__map.itervalues():
del node[:]
root = self.__root
root[:] = [root, root, None]
self.__map.clear()
except AttributeError:
pass
dict.clear(self)
def popitem(self, last=True):
'''od.popitem() -> (k, v), return and remove a (key, value) pair.
Pairs are returned in LIFO order if last is true or FIFO order if false.
'''
if not self:
raise KeyError('dictionary is empty')
root = self.__root
if last:
link = root[0]
link_prev = link[0]
link_prev[1] = root
root[0] = link_prev
else:
link = root[1]
link_next = link[1]
root[1] = link_next
link_next[0] = root
key = link[2]
del self.__map[key]
value = dict.pop(self, key)
return key, value
# -- the following methods do not depend on the internal structure --
def keys(self):
'od.keys() -> list of keys in od'
return list(self)
def values(self):
'od.values() -> list of values in od'
return [self[key] for key in self]
def items(self):
'od.items() -> list of (key, value) pairs in od'
return [(key, self[key]) for key in self]
def iterkeys(self):
'od.iterkeys() -> an iterator over the keys in od'
return iter(self)
def itervalues(self):
'od.itervalues -> an iterator over the values in od'
for k in self:
yield self[k]
def iteritems(self):
'od.iteritems -> an iterator over the (key, value) items in od'
for k in self:
yield (k, self[k])
def update(*args, **kwds):
'''od.update(E, **F) -> None. Update od from dict/iterable E and F.
If E is a dict instance, does: for k in E: od[k] = E[k]
If E has a .keys() method, does: for k in E.keys(): od[k] = E[k]
Or if E is an iterable of items, does: for k, v in E: od[k] = v
In either case, this is followed by: for k, v in F.items(): od[k] = v
'''
if len(args) > 2:
raise TypeError('update() takes at most 2 positional '
'arguments (%d given)' % (len(args),))
elif not args:
raise TypeError('update() takes at least 1 argument (0 given)')
self = args[0]
# Make progressively weaker assumptions about "other"
other = ()
if len(args) == 2:
other = args[1]
if isinstance(other, dict):
for key in other:
self[key] = other[key]
elif hasattr(other, 'keys'):
for key in other.keys():
self[key] = other[key]
else:
for key, value in other:
self[key] = value
for key, value in kwds.items():
self[key] = value
__update = update # let subclasses override update without breaking __init__
__marker = object()
def pop(self, key, default=__marker):
'''od.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
'''
if key in self:
result = self[key]
del self[key]
return result
if default is self.__marker:
raise KeyError(key)
return default
def setdefault(self, key, default=None):
'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od'
if key in self:
return self[key]
self[key] = default
return default
def __repr__(self, _repr_running={}):
'od.__repr__() <==> repr(od)'
call_key = id(self), _get_ident()
if call_key in _repr_running:
return '...'
_repr_running[call_key] = 1
try:
if not self:
return '%s()' % (self.__class__.__name__,)
return '%s(%r)' % (self.__class__.__name__, self.items())
finally:
del _repr_running[call_key]
def __reduce__(self):
'Return state information for pickling'
items = [[k, self[k]] for k in self]
inst_dict = vars(self).copy()
for k in vars(OrderedDict()):
inst_dict.pop(k, None)
if inst_dict:
return (self.__class__, (items,), inst_dict)
return self.__class__, (items,)
def copy(self):
'od.copy() -> a shallow copy of od'
return self.__class__(self)
@classmethod
def fromkeys(cls, iterable, value=None):
'''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S
and values equal to v (which defaults to None).
'''
d = cls()
for key in iterable:
d[key] = value
return d
def __eq__(self, other):
'''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive
while comparison to a regular mapping is order-insensitive.
'''
if isinstance(other, OrderedDict):
return len(self)==len(other) and self.items() == other.items()
return dict.__eq__(self, other)
def __ne__(self, other):
return not self == other
# -- the following methods are only used in Python 2.7 --
def viewkeys(self):
"od.viewkeys() -> a set-like object providing a view on od's keys"
return KeysView(self)
def viewvalues(self):
"od.viewvalues() -> an object providing a view on od's values"
return ValuesView(self)
def viewitems(self):
"od.viewitems() -> a set-like object providing a view on od's items"
return ItemsView(self)
\ No newline at end of file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Main program of the Client written for CIRCLE Cloud.
The Client job is to help the ease of use of the cloud system.
"""
import platform
import argparse
try:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
except ImportError:
pass
class Struct:
"""
A struct used for parameter passing
Keyword arguments:
state -- State of the Virtual Computer (running, etc..)
protocol -- SSH, NX and RDP possible
host -- Address of the Virtual Computer
port -- The port where we can access the Virtual Computer
user -- Username used for the connection
password -- Password used for the connection
"""
pass
def parse_arguments():
"""
Argument parser, based on the argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser = argparse.ArgumentParser()
parser.add_argument(
"uri", type=str, help="Specific schema handler", nargs='?',
default=None)
parser.add_argument("-u", "--username", type=str)
parser.add_argument("-p", "--password", type=str)
parser.add_argument(
"-d", "--driver",
help="Select webdriver. Aside from Firefox, you have to install "
+ "first the proper driver.", type=str,
choices=['firefox', 'chrome', 'ie', 'opera'],
default="firefox")
args = parser.parse_args()
return args
class Browser:
"""
Browser initialisation
Keyword arguments:
@param args -- args.driver tells us which installed browser
we want to use with selenium.
"""
def __init__(self, args):
self.args = args
if args.driver == "firefox":
self.driver = webdriver.Firefox()
elif args.driver == "chrome":
self.driver = webdriver.Chrome()
elif args.driver == "ie":
self.driver = webdriver.Ie()
elif args.driver == "opera":
self.driver = webdriver.Opera()
self.driver.implicitly_wait(10)
def login(self):
"""
Eduid login based on the given console arguments
"""
driver = self.driver
args = self.args
if args.username is not None:
driver.find_element_by_name("j_username").clear()
driver.find_element_by_name("j_username").send_keys(args.username)
if args.password is not None:
driver.find_element_by_name("j_password").clear()
driver.find_element_by_name("j_password").send_keys(args.password)
if args.username is not None and args.password is not None:
driver.find_element_by_css_selector(
"input[type='submit']").click()
def main(self):
"""
Use of the https://cloud.bme.hu/
Keyword arguments:
@return vm -- Necessarily parameters to connect
to the Virtual Machine
"""
vm = Struct()
driver = self.driver
driver.maximize_window()
driver.get("https://cloud.bme.hu/")
# driver.find_element_by_css_selector("a[href*='/login/']").click()
# self.login()
vm.state, vm.protocol = "", "NONE"
try:
while vm.state.upper()[:3] not in ("FUT", "RUN"):
WebDriverWait(driver, 7200).until(
EC.presence_of_element_located((
By.CSS_SELECTOR,
"#vm-details-pw-eye.fa.fa-eye-slash")))
vm.state = driver.find_element_by_css_selector(
"#vm-details-state > span").text
# cl: connection string converted to list
cl = driver.find_element_by_css_selector(
"#vm-details-connection-string").get_attribute(
"value").split()
if cl[0] == "sshpass":
vm.protocol = "SSH"
vm.user, vm.host = cl[6].split("@")
vm.password, vm.port = cl[2], cl[8]
elif cl[0] == "rdesktop":
vm.protocol = "RDP"
vm.host, vm.port = cl[1].split(":")
vm.user, vm.password = cl[3], cl[5]
driver.find_element_by_css_selector("a[href*='/logout/']").click()
except:
print "Browser session timed out!"
raise
return vm
def main():
"""
Main program
"""
try:
args = parse_arguments()
if args.uri is not None:
vm = Struct()
x, vm.protocol, vm.user, vm.password, vm.host, vm.port = \
args.uri.split(':', 5)
vm.protocol = vm.protocol.upper()
vm.state = "RUN"
else:
browser = Browser(args)
vm = browser.main()
browser.driver.quit()
if platform.system() == "Linux":
from cloud_connect_from_linux import connect
elif platform.system() == "Windows":
from cloud_connect_from_windows import connect
if vm.state.upper()[:3] in ("FUT", "RUN"):
connect(vm)
except:
print "Unknown error occurred! Please contact the developers!"
if __name__ == "__main__":
main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Configuration of the Windows specific tools to enhance the ease of use
of the CIRCLE cloud. Handles the auto launch and auto configuration
of these specific connectivity programs.
"""
import time
import os
import subprocess
import glob
import win32crypt
import binascii
import nxkey
def connect(vm):
"""
Handles to connection to the Virtual Machines from the local
machine
Keyword arguments:
vm.protocol -- SSH, NX and RDP possible
vm.host -- Address of the Virtual Computer
vm.port -- The port where we can access the Virtual Computer
vm.user -- Username used for the connection
vm.password -- Password used for the connection
"""
if vm.protocol == "SSH":
arguments = ("-ssh -P %s -pw %s" % (vm.port, vm.password)
+ " %s@%s" % (vm.user, vm.host))
subprocess.Popen("putty.exe "+arguments, shell=True)
elif vm.protocol == "NX":
listdir = os.path.expanduser("~\\.nx\\config\\*.nxs")
found = False
server = "\"Server host\" value=\"%s\"" % vm.host
port = "\"Server port\" value=\"%s\"" % vm.port
for config_file in glob.glob(listdir):
with open(config_file) as f:
file = f.read()
if server in file and port in file:
found = True
break
if not found:
config_file = "%s%s%s" % (os.path.expanduser("~\\.nx\\config\\"),
str(int(time.time()*1000)), ".nxs")
password = nxkey.NXKeyGen(vm.password).getEncrypted()
config = NX_template % {'USERNAME': vm.user, 'PASSWORD': password,
'HOST': vm.host, 'PORT': vm.port}
f = open(config_file, 'w')
f.write(config)
f.close()
subprocess.Popen(config_file, shell=True)
elif vm.protocol == "RDP":
listdir = os.path.dirname(os.path.realpath(__file__))+"\\.rdp\\*.rdp"
found = False
full_address = "full address:s:%s:%s" % (vm.host, vm.port)
user = "username:s:%s" % vm.user
for config_file in glob.glob(listdir):
with open(config_file) as f:
file = f.read()
if full_address in file and user in file:
found = True
break
if not found:
config_file = "%s%s%s" % ((os.path.dirname(
os.path.realpath(__file__))+"\\.rdp\\"),
str(int(time.time()*1000)), ".rdp")
password = binascii.hexlify(win32crypt.CryptProtectData(
u"%s" % vm.password, u'psw', None, None, None, 0))
config = RPD_template % {'USERNAME': vm.user, 'PASSWORD': password,
'HOST': vm.host, 'PORT': vm.port}
f = open(config_file, 'w')
f.write(config)
f.close()
subprocess.Popen(config_file, shell=True)
NX_template = """<!DOCTYPE NXClientSettings>
<NXClientSettings application="nxclient" version="1.3" >
<group name="General" >
<option key="Remember password" value="true" />
<option key="Resolution" value="fullscreen" />
<option key="Server host" value="%(HOST)s" />
<option key="Server port" value="%(PORT)s" />
<option key="Session" value="unix" />
</group>
<group name="Login" >
<option key="Auth" value="%(PASSWORD)s" />
<option key="Guest Mode" value="false" />
<option key="Login Method" value="nx" />
<option key="User" value="%(USERNAME)s" />
</group>
</NXClientSettings>"""
RPD_template = """username:s:%(USERNAME)s
full address:s:%(HOST)s:%(PORT)s
password 51:b:%(PASSWORD)s"""
This source diff could not be displayed because it is too large. You can view the blob instead.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
NX Client for Windows installer
Checks whether NX Client for Windows is installed in the system, the
classes used for this process are used for other operations too.
"""
import os
import argparse
import subprocess
import time
import windowsclasses
def parse_arguments():
"""
Argument parser, based on argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser = argparse.ArgumentParser()
if windowsclasses.DecideArchitecture.Is64Windows():
local_default = (windowsclasses.DecideArchitecture.GetProgramFiles64()
+ "\\CIRCLE\\")
else:
local_default = (windowsclasses.DecideArchitecture.GetProgramFiles32()
+ "\\CIRCLE\\")
if (not os.path.exists(local_default[:-1])
and os.path.exists(os.environ['APPDATA']+"\\CIRCLE")):
local_default = os.environ['APPDATA']+"\\CIRCLE\\"
parser.add_argument(
"-l", "--location",
help="Location of the client files in the system",
default=local_default)
args = parser.parse_args()
return args
def main():
try:
nx_install_location = None
while nx_install_location is None:
print "Checking whether NX Client for Windows is installed"
handler = windowsclasses.RegistryHandler()
try:
nx_install_location = handler.get_key_value(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\"
+ "Uninstall\\nxclient_is1",
"InstallLocation", "key")
print ("NX Client for Windows is found at "
"'%s'" % nx_install_location)
process = subprocess.Popen(
"%s\\nxclient.exe" % nx_install_location)
time.sleep(2)
process.terminate()
except:
print "NX Client for Windows isn't installed on the system."
print "\tCommencing the install"
subprocess.Popen(os.path.dirname(
os.path.realpath(__file__))
+ "\\nxclient-3.5.0-9.exe").wait()
except:
pass
if __name__ == "__main__":
main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generating NoMachine NX scrambled key according to
https://www.nomachine.com/AR01C00125
"""
import sys
import random
from xml.sax.saxutils import escape
class NXKeyGen:
"""
NXKeyGen class
Creates NoMachine NX scrambled keys
"""
numValidCharList = 85
dummyString = "{{{{"
def __init__(self, password):
"""
Initialize the class
Keyword arguments:
@param password -- Password that will be scrambled
"""
self.password = password
def getEncrypted(self):
"""
Encrypt (scramble) the given password
Keyword arguments:
@return scrambleString -- Scrambled version of the original
password
"""
return self.scrambleString(self.password)
def getvalidCharList(self, pos):
"""
Valid character list
Keyword arguments:
@return validcharlist -- List of the valid characters
"""
validcharlist = [
"!", "#", "$", "%", "&", "(", ")", "*", "+", "-",
".", "0", "1", "2", "3", "4", "5", "6", "7", "8",
"9", ":", ";", "<", ">", "?", "@", "A", "B", "C",
"D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W",
"X", "Y", "Z", "[", "]", "_", "a", "b", "c", "d",
"e", "f", "g", "h", "i", "j", "k", "l", "m", "n",
"o", "p", "q", "r", "s", "t", "u", "v", "w", "x",
"y", "z", "{", "|", "}"]
return validcharlist[pos]
def encodePassword(self, p):
"""
Password encoder
Keyword arguments:
@return sPass -- Encoded password
"""
sPass = ":"
sTmp = ""
if not p:
return ""
for i in range(len(p)):
c = p[i:i+1]
a = ord(c)
sTmp = str(a + i + 1) + ":"
sPass += sTmp
sTmp = ""
return sPass
def findCharInList(self, c):
"""
Character position finder
Keyword arguments:
@param c -- Character that needs to be matched if valid
@return i -- Place where the character is in the valid list
"""
i = -1
for j in range(self.numValidCharList):
randchar = self.getvalidCharList(j)
if randchar == c:
i = j
return i
return i
def getRandomValidCharFromList(self):
"""
Random valid character getter
Keyword arguments:
@return char -- Valid character placed 0-60 in the valid list
"""
return self.getvalidCharList(random.randint(0, 60))
def scrambleString(self, s):
"""
Password scrambler
Keyword arguments:
@param s -- Password that needs to be scrambled
@return sRet -- NoMachine NX scrambled password
"""
sRet = ""
if not s:
return s
strp = self.encodePassword(s)
if len(strp) < 32:
sRet += self.dummyString
for iR in reversed(range(len(strp))):
sRet += strp[iR:iR+1]
if len(sRet) < 32:
sRet += self.dummyString
app = self.getRandomValidCharFromList()
k = ord(app)
l = k + len(sRet) - 2
sRet = app + sRet
for i1 in range(1, len(sRet)):
app2 = sRet[i1: i1 + 1]
j = self.findCharInList(app2)
if j == -1:
return sRet
i = (j + l * (i1 + 1)) % self.numValidCharList
car = self.getvalidCharList(i)
sRet = self.substr_replace(sRet, car, i1, 1)
c = (ord(self.getRandomValidCharFromList())) + 2
c2 = chr(c)
sRet = sRet + c2
return escape(sRet)
def substr_replace(self, in_str, ch, pos, qt):
"""
Replace a character at a special position
"""
clist = list(in_str)
count = 0
tmp_str = ''
for key in clist:
if count != pos:
tmp_str += key
else:
tmp_str += ch
count = count+1
return tmp_str
if __name__ == "__main__":
NXPass = NXKeyGen(sys.argv[1])
print NXPass.password
print NXPass.getEncrypted()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pywin32 installer for CIRCLE client application
"""
import os
import sys
import subprocess
import windowsclasses
def main():
"""
Main program
Job:
Install Pywin32 to the computer
"""
if sys.hexversion < 0x02060000:
print "Not a 2.6+ version Python is running, commencing update"
subprocess.Popen(
"%s\\no_root_install.bat" % os.path.dirname(
os.path.realpath(__file__)))
sys.exit(1)
else:
pywin32_version = str(219)
if sys.hexversion < 0x02070000:
if windowsclasses.DecideArchitecture.Is64Windows():
subprocess.Popen(
"%s\\x64\\pywin32-%s.win-amd64-py2.6.exe" % (
os.path.dirname(os.path.realpath(__file__)),
pywin32_version)).wait()
else:
subprocess.Popen(
"%s\\x86\\pywin32-%s.win32-py2.6.exe" % (
os.path.dirname(os.path.realpath(__file__)),
pywin32_version)).wait()
elif sys.hexversion < 0x02080000:
if windowsclasses.DecideArchitecture.Is64Windows():
subprocess.Popen(
"%s\\x64\\pywin32-%s.win-amd64-py2.7.exe" % (
os.path.dirname(os.path.realpath(__file__)),
pywin32_version)).wait()
else:
subprocess.Popen(
"%s\\x86\\pywin32-%s.win32-py2.7.exe" % (
os.path.dirname(os.path.realpath(__file__)),
pywin32_version)).wait()
else:
print "Unsupported Python version is found!"
if __name__ == "__main__":
main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Windows icon installer for CIRCLE client application
"""
import os
import argparse
import subprocess
import pythoncom
import shutil
import sys
from win32com.shell import shell, shellcon
import windowsclasses
try:
from collections import * # noqa
except ImportError:
from OrderedDict import * # noqa
def parse_arguments():
"""
Argument parser, based on argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser = argparse.ArgumentParser()
parser.add_argument(
"-d", "--driver",
help="Select webdriver. Aside from Firefox, you have to install "
+ "first the proper driver.", type=str, default="firefox",
required=False, choices=['firefox', 'chrome',
'iexplore', 'opera'])
if windowsclasses.DecideArchitecture.Is64Windows():
local_default = (windowsclasses.DecideArchitecture.GetProgramFiles64()
+ "\\CIRCLE\\")
else:
local_default = (windowsclasses.DecideArchitecture.GetProgramFiles32()
+ "\\CIRCLE\\")
if (not os.path.exists(local_default[:-1]) and
os.path.exists(os.environ['APPDATA'] + "\\CIRCLE")):
local_default = os.environ['APPDATA'] + "\\CIRCLE\\"
parser.add_argument(
"-l", "--location", help="Location of the client files in the system",
default=local_default, required=False)
parser.add_argument(
"-r", "--remove",
help="Remove installed files instead of creating them",
action="store_true", required=False)
parser.add_argument(
"-u", "--url",
help="Whether we installed and we want to use selenium or not",
action="store_true", required=False)
parser.add_argument(
"-t", "--target",
help="If this is an URL icon, where should it point",
default="https://cloud.bme.hu/", required=False)
args = parser.parse_args()
return args
def custom_protocol_register(custom_protocol):
"""
Custom protocol register based on RegistryHandler module
Can raise AttributeError on wrongly provided dictionary chain
Keyword arguments:
@param dict_chain -- OrderedDictionary chain of the registry tree
"""
if not isinstance(custom_protocol, OrderedDict):
raise AttributeError
print "\t"+custom_protocol.iterkeys().next()
try:
custom_arguments = windowsclasses.Struct()
custom_arguments.registry = "HKCR"
handler = windowsclasses.RegistryHandler(custom_arguments)
handler.create_registry_from_dict_chain(custom_protocol, True)
print "\t\tDone!"
except:
raise
def main():
"""
Main program
Jobs:
read the parameters
create a proper icon with the proper driver (or delete)
call the nx_client_installer
"""
try:
args = parse_arguments()
shortcut = pythoncom.CoCreateInstance(
shell.CLSID_ShellLink,
None,
pythoncom.CLSCTX_INPROC_SERVER,
shell.IID_IShellLink
)
desktop_path = shell.SHGetFolderPath(
0, shellcon.CSIDL_DESKTOP, 0, 0)
if args.remove:
location = os.path.join(desktop_path, "Cloud GUI")
if os.path.isfile("%s%s" % (location, ".lnk")):
os.remove("%s%s" % (location, ".lnk"))
if os.path.isfile("%s%s" % (location, ".url")):
os.remove("%s%s" % (location, ".url"))
else:
subprocess.call(
"python %s\\nx_client_installer.py" % os.path.dirname(
os.path.realpath(__file__)))
if args.url:
location = os.path.join(desktop_path, "Cloud GUI.url")
shortcut = file(location, 'w')
shortcut.write('[InternetShortcut]\n')
shortcut.write('URL='+args.target)
shortcut.close()
else:
shortcut.SetPath(args.location+"cloud.py")
if args.driver == "chrome":
shortcut.SetArguments("-d chrome")
elif args.driver == "iexplore":
shortcut.SetArguments("-d ie")
elif args.driver == "opera":
shortcut.SetArguments("-d opera")
shortcut.SetDescription("Tool to use CIRCLE Cloud")
shortcut.SetIconLocation(args.location+"cloud.ico", 0)
desktop_path = shell.SHGetFolderPath(
0, shellcon.CSIDL_DESKTOP, 0, 0)
persist_file = shortcut.QueryInterface(
pythoncom.IID_IPersistFile)
location = os.path.join(desktop_path, "Cloud GUI.lnk")
persist_file.Save(location, 0)
print "Icon successfully created on desktop"
shutil.copy(location, args.location)
print "Creating custom URL protocol handlers"
try:
custom_protocol = OrderedDict([
('circle', ["default",
"URL:circle Protocol",
"URL Protocol",
""]),
('circle\\URL Protocol', ""),
('circle\\DefaultIcon', args.location+"cloud.ico"),
('circle\\shell', {'open': {
'command': r'"%s\pythonw.exe"' % sys.exec_prefix
+ r' "%s' % args.location
+ r'\cloud.py" "%1"'}})])
custom_protocol_register(custom_protocol)
except:
print "Error! URL Protocol handler installation aborted!"
except:
print "Unknown error occurred! Please contact the developers!"
if __name__ == "__main__":
main()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Place holder for all windows specific frequently used classes.
Currently here:
RegistryHandler - Registry based operations
DecideArchitecture - Accurate way to decide operating system architecture
"""
import os
import argparse
import errno
from _winreg import * # noqa
try:
from collections import * # noqa
except ImporError:
from OrderedDict import * # noqa
def parse_arguments():
"""
Argument parser, based on argparse module
Keyword arguments:
@return args -- arguments given by console
"""
parser = argparse.ArgumentParser()
parser.add_argument(
"-g", "--global",
help="Whether we want to edit registry globally or just locally",
action="store_true")
parser.add_argument(
"-d", "--different",
help="Only handle the architecture specific registry area",
action="store_true")
parser.add_argument(
"-r", "--registry",
help="Which HKEY_* const registry type the program should use",
type=str, choices=['HKLM', 'HKCR', 'HKCU', 'HKU', 'HKPD', 'HKCC'],
default="HKLM")
args = parser.parse_args()
return args
def main():
return RegistryHandler(parse_arguments())
class Struct:
"""
Parameter bypassing struct
"""
pass
class RegistryHandler:
"""
Registry handling class, makes registry based queries and
manipulations easier.
This class can handle WOW64 based application differently and none
differently (default)
"""
def __init__(self, args=None):
"""Initialise RegistryHandler
Keyword arguments:
@param args -- The arguments that decide how the we should
handle the registry
args.registry -- What base registry should we use
(default: HKLM)
Raises AttributeError if not supported base registry type is
given
args.different -- Whether we handle registry redirection or not
"""
if args is None:
self.args = Struct()
self.args.different = None
self.args.registry = None
else:
if not hasattr(args, 'different'):
args.different = None
if not hasattr(args, 'registry'):
args.registry = None
self.args = args
if self.args.different is None:
self.args.different = False
if self.args.registry is None or self.args.registry == "HKLM":
self.args.registry = HKEY_LOCAL_MACHINE
elif self.args.registry == "HKCR":
self.args.registry = HKEY_CLASSES_ROOT
elif self.args.registry == "HKCU":
self.args.registry = HKEY_CURRENT_USER
elif self.args.registry == "HKU":
self.args.registry = HKEY_USERS
elif self.args.registry == "HKPD":
self.args.registry = HKEY_PERFORMANCE_DATA
elif self.args.registry == "HKCC":
self.args.registry = HKEY_CURRENT_CONFIG
else:
# print "Non supported registry type"
raise AttributeError
def connect_registry(self):
"""
Getting a registry open
Keyword arguments:
@return connected_registy -- Reference to the newly opened
registry
"""
return ConnectRegistry(None, self.args.registry)
def create_registry_from_dict_chain(
self, dict_chain, both=False, architect=KEY_WOW64_64KEY,
needed_rights=KEY_ALL_ACCESS):
""""
Create registry key and value multilevel tree by chained
dictionaries.
Can raise AttributeError if the provided dict chain isn't
correct
Keyword arguments:
@param key_value_chain -- The dict chain containing all the
information
@param both -- Whether create the registry in WOW64
node too
@param architect -- The current registry view (
only change it if we want to fill the
WOW6432 registry only [both = False],
on x64 windows)
@param needed_rights -- SAM rights to access the key
"""
if both and architect is KEY_WOW64_64KEY:
self.create_registry_from_dict_chain(
dict_chain, False, KEY_WOW64_32KEY, needed_rights)
if not DecideArchitecture.Is64Windows():
architect = 0
connected_registy = self.connect_registry()
if (isinstance(dict_chain, dict)
or isinstance(dict_chain, OrderedDict)):
for key, value in dict_chain.iteritems():
if isinstance(value, dict) or isinstance(value, OrderedDict):
temp_dict = OrderedDict()
for my_key, my_value in value.iteritems():
temp_dict[key+"\\"+my_key] = my_value
self.create_registry_from_dict_chain(
temp_dict, False, architect, needed_rights)
else:
if isinstance(value, list):
if len(value) % 2 != 0:
# print "Not enough member in the list"
raise AttributeError
else:
new_key = CreateKeyEx(
connected_registy, key, 0,
needed_rights | architect)
temp_dict = OrderedDict(
value[i:i+2] for i in range(
0, len(value), 2))
for my_key, my_value in temp_dict.iteritems():
if my_key == "default":
my_key = None
SetValueEx(
new_key, my_key, 0, REG_SZ, my_value)
else:
new_key = CreateKeyEx(
connected_registy, key, 0,
needed_rights | architect)
SetValueEx(new_key, None, 0, REG_SZ, value)
else:
print "The provided attribute wasn't a dictionary chain"
raise AttributeError
def get_key(self, key_name, needed_rights=KEY_ALL_ACCESS):
"""
Getting a registry value by it's key's name
Can raise KeyError if key is not found in the registry
Keyword arguments:
@param key_name -- The specific key name of which value we
are interested in
@param needed_rights -- SAM rights to access the key
@return -- [key, architect]
key -- Reference to the opened
key handler
architect -- 0 for x86
KEY_WOW64_32KEY or
KEY_WOW64_64KEY
depending where we
found the key on x64
"""
connected_registy = self.connect_registry()
architect = 0
if DecideArchitecture.Is64Windows():
architect = KEY_WOW64_64KEY
try:
key = OpenKey(connected_registy, key_name, 0,
needed_rights | architect)
except WindowsError:
if DecideArchitecture.Is64Windows() and not self.args.different:
try:
architect = KEY_WOW64_32KEY
key = OpenKey(connected_registy, key_name,
0, needed_rights | architect)
except WindowsError:
raise KeyError
else:
raise KeyError
return [key, architect]
def get_key_values(
self, key_name, subkey_list, subroutine=False,
depth="subkeys"):
"""
Getting registry subkeys value by it's key's name and subkeys
name
Can raise LookupError exception if there are missing data
Can raise AttributeError exception if depth attribute is wrong
Keyword arguments:
@param key_name -- The specific key name of which subkey's
we are interested in
@param subkey_list -- List containing all the subkeys names
which values we are interested in
@param subroutine -- Whether suppress exception about not
having enough results or not
(default: False)
@param depth -- How depth the search should go for
[options: key, subkeys, all]
(default: subkeys)
@return results{} -- Dictionary with the subkey_name - value
combinations as keys and values
"""
if depth == "key":
int_depth = 0
elif depth == "subkeys":
int_depth = 1
elif depth == "all":
int_depth = 2
else:
raise AttributeError
try:
key_and_architect = self.get_key(key_name)
key = key_and_architect[0]
architect = key_and_architect[1]
except KeyError:
# print "%s doesn't exist in the registry" % key_name
raise LookupError
# print "%s found in the registry" % key_name
results = {}
if int_depth >= 1:
for i in xrange(0, QueryInfoKey(key)[0]-1):
skey_name = EnumKey(key, i)
skey = OpenKey(key, skey_name, 0, KEY_ALL_ACCESS | architect)
if int_depth == 2 and QueryInfoKey(skey)[0] > 0:
for key, value in self.get_key_values(
skey_name, subkey_list, True, depth).iteritems():
results[key] = value
for subkey_name in subkey_list:
try:
results[subkey_name] = QueryValueEx(
skey, subkey_name)[0]
except OSError as e:
if e.errno == errno.ENOENT:
# print ("%s doesn't exist in this" % subkey_name
# " subkey")
pass
skey.Close()
if not results or len(results) != len(subkey_list):
for subkey_name in subkey_list:
try:
results[subkey_name] = QueryValueEx(key, subkey_name)[0]
except OSError as e:
pass
key.Close()
if len(results) != len(subkey_list):
# print "We are missing important variables"
raise LookupError
return results
def get_key_value(
self, key_name, subkey_name, subroutine=None, depth=None):
"""
This is a wrapper for the get_key_values to be easier to use
for single subkeys.
Getting registry subkey value by it's key's name and subkey
name
Keyword arguments:
@param key_name -- The specific key name of which subkey's
we are interested in
@param subkey_name -- The specific subkey name which value we
are interested in
@param subroutine -- can be found at: get_key_values
@param depth -- can be found at: get_key_values
@return value -- Value of the specific subkey
"""
try:
if subroutine is None:
return self.get_key_values(
key_name, [subkey_name])[subkey_name]
elif depth is None:
return self.get_key_values(
key_name, [subkey_name], subroutine)[subkey_name]
else:
return self.get_key_values(
key_name, [subkey_name], subroutine, depth)[subkey_name]
except:
raise
class DecideArchitecture:
"""
Helper class to get the true ProgramFiles directory.
This class doesn't depend on Phyton or Windows architecture.
"""
@staticmethod
def Is64Windows():
return 'PROGRAMFILES(X86)' in os.environ
@staticmethod
def GetProgramFiles32():
if DecideArchitecture.Is64Windows():
return os.environ['PROGRAMFILES(X86)']
else:
return os.environ['PROGRAMFILES']
@staticmethod
def GetProgramFiles64():
if DecideArchitecture.Is64Windows():
return os.environ['PROGRAMW6432']
else:
return None
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