myosotis schrieb: ↑31. Dez. 2017 - 16:06 Uhr
Können wir nicht mit den App-Daten des aktuellen Benutzers interagieren, während ein Paket bereitgestellt wird?
Es ist möglich, aber komplizierter; die Einrichtung einer Sitzung vereinfacht die Sache:
Code: Alle auswählen
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
key = "{1E9DFEBB-4088-4693-A521-C755318BD492}_is1"
profil_name = 'com.makeblock.Scratch3.4.11'
profil_mblock_appdata = makepath('c:','ProgramData','mblock',profil_name)
profil_mblock = makepath(application_data(),profil_name)
def install():
versionpaquet = control['version'].split('-',1)[0]
print('Importation des drivers')
with disable_file_system_redirection():
run('regedit.exe /s usbserial_arduino.reg')
run(r'"%s" /VERYSILENT' % makepath('drivers','Driver_for_Windows.exe'))
print('installing aiz-mblock')
install_exe_if_needed("mBlock_win_V"+versionpaquet+".exe",
silentflags="/VERYSILENT",
key=key,
min_version=versionpaquet,
killbefore="mBlock.exe")
#suppression de la clé de désinstallation pour pouvoir faire une désinstallation silencieuse. Voir def uninstall():
uninstallkey.remove(key)
#suppression du raccourci bureau
remove_desktop_shortcut('mBlock')
if isdir(profil_mblock_appdata):
remove_tree(profil_mblock_appdata)
copytree2(profil_name,profil_mblock_appdata)
def session_setup():
if isdir(profil_mblock):
remove_tree(profil_mblock)
copytree2(profil_mblock_appdata,profil_mblock)
def uninstall():
print('uninstalling aiz-mblock')
run(r'"%s\unins000.exe" /VERYSILENT' % install_location(key))
Das Profil "com.makeblock.Scratch3.4.11" wird beim nächsten Login überschrieben.
Auf diese Weise funktioniert es einwandfrei, selbst wenn das Benutzerprofil noch nicht existiert!
Vergessen Sie nicht, die Paketversionsnummer nach jeder Änderung an den Sitzungseinstellungen zu erhöhen!