Insmonia package
Published: September 27, 2023 - 2:18 PM
Good morning
I tried to create a package for installing the Insomnia program (https://insomnia.rest/downloadThis can be installed via a portable application or with an application that installs in AppData (I was unable to complete the installation using this method)
I tried to base my work on the tis-bitwarden-portable package
Below is the setup.py file
However, during uninstallation, the application stored in AppData is not deleted...
And I have the impression that the session setup doesn't start after the application is installed; I have to force the session setup with `wapt-get session-setup -f ALL`
Can you help me improve my package?
Thank you all
I tried to create a package for installing the Insomnia program (https://insomnia.rest/downloadThis can be installed via a portable application or with an application that installs in AppData (I was unable to complete the installation using this method)
I tried to base my work on the tis-bitwarden-portable package
Below is the setup.py file
Code: Select all
# -*- coding: utf-8 -*-
from setuphelpers import *
app_bin = "Insomnia.Core-2023.5.8-portable.exe"
app_dir = makepath(programfiles32, "Insomnia")
app_bin_path = makepath(app_dir, app_bin)
processes_to_kill = ["Insomnia"]
def install():
# Initializing variables
package_version = control.version.split("-", 1)[0]
bin_name = bin_name = glob.glob("Insomnia.Core-*.exe")[0]
# Installing the package
print("Installing: %s" % bin_name)
if get_version_from_binary(app_bin_path) != package_version:
killalltasks(processes_to_kill)
if isdir(app_dir):
remove_tree(app_dir)
mkdirs(app_dir)
print("Copying %s to %s " % (bin_name, app_bin_path))
filecopyto(bin_name, app_bin_path)
# remove_programs_menu_shortcut("Insomnia")
# Adding this package to the "list-registry"
register_windows_uninstall(control) # control is a PackageEntry object corresponding to this package
else:
print("%s portable version is already installed in the correct version" % "Insomnia")
def session_setup():
# Initializing variables
user_app_dir = makepath(application_data, "Insomnia")
user_app_bin_path = makepath(user_app_dir, app_bin)
# Installing the package in user env
print("Installing: %s in user env" % "Insomnia")
if get_version_from_binary(user_app_bin_path) != installed_softwares("Insomnia")[0]["version"]:
killalltasks(processes_to_kill)
if isdir(user_app_dir):
remove_tree(user_app_dir)
mkdirs(user_app_dir)
print("Copying %s to %s " % (app_bin_path, user_app_bin_path))
filecopyto(app_bin_path, user_app_bin_path)
create_user_programs_menu_shortcut("Insomnia", user_app_bin_path)
else:
print("%s portable version in user env is already installed in the correct version" % "Insomnia")
def uninstall():
# Uninstalling the package
killalltasks(processes_to_kill)
if isdir(app_dir):
remove_tree(app_dir)
unregister_uninstall("Insomnia")And I have the impression that the session setup doesn't start after the application is installed; I have to force the session setup with `wapt-get session-setup -f ALL`
Can you help me improve my package?
Thank you all