import winshell
from os.path import join


class Desktop:
    def __init__(self, name, path, version):
        self.name = name
        self.path = path
        self.version = version
        self.exe = "elonapluscgx.exe"

    def create_shortcut(self):
        desktop = winshell.desktop()
        with winshell.shortcut(join(desktop, self.name + ' ' + self.version + ".lnk")) as shortcut:
            shortcut.path = self.path + self.exe
            shortcut.icon_location = self.path + self.exe, 0
            shortcut.description = "ElonaPlusCGX " + self.version
