tis-disable-onedrive icon

Disable OneDrive

Silent install package for Disable OneDrive

1.2-6

  • package: tis-disable-onedrive
  • name: Disable OneDrive
  • version: 1.2-6
  • categories: Security
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • locale: all
  • target_os: windows
  • architecture: all
  • signature_date:
  • size: 7.86 Ko
  • conflicts :

package           : tis-disable-onedrive
version           : 1.2-6
architecture      : all
section           : base
priority          : optional
name              : Disable OneDrive
categories        : Security
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Remove Microsoft OneDrive
depends           : 
conflicts         : tis-onedrive
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 1.7
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Supprime Microsoft OneDrive
description_pl    : Odinstaluj Microsoft OneDrive
description_de    : Deinstallieren Sie Microsoft OneDrive
description_es    : Desinstalar Microsoft OneDrive
description_pt    : Remover o Microsoft OneDrive
description_it    : Rimuovere Microsoft OneDrive
description_nl    : Microsoft OneDrive verwijderen
description_ru    : Удалить Microsoft OneDrive
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : 833ac080-2d85-428e-bf0d-4fd8615753e4
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : 7985d44f9fa263dbebd44f6ba8b1579f6a587c9feca55a4d9084e7bb88a3172a
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : Pwv9XWW8nvWzvUXnmdhsK/Q3V+6+DagJUsTrwY2gYOlwnN4r74Ch6/kJI2ocfqCl6IK8/pQFYIkqGVLXR1CvRnS/2ct/ThOnoS4CwoJRrvSKLqa1eRxXUDxQXfgQzSj4z948EBVcFanGLG3ZmnvlukkRMEfxBU4S0utChVno1LgBUURDADfTHtFPZ20MvWGGuay6VpJMxC3tAnUq6QAYgAH5Url7t2Qjvm39Wl38/jaHTFgAFuC00wOlfCZpD/FoBWTtUQ+gcxPoMWgTiF2zxrVc0Ht7os6D2MBJft6XkSYfjHSS5fpzVdtreaE1oFcyBcCkpIr1Mke4Q2Vly65T3Q==
signature_date    : 2022-08-30T19:02:24.488140
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

# -*- coding: utf-8 -*-
from setuphelpers import *

"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
processes_to_kill = "OneDrive.exe"


def install():
    # Disabling OneDrive in sys env
    killalltasks(processes_to_kill)

    registry_set(HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC", 1, REG_DWORD)
    onedrive32 = makepath(system32, "OneDriveSetup.exe")
    onedrive64 = makepath(os.getenv("SystemRoot"), "SysWOW64", "OneDriveSetup.exe")
    if isfile(onedrive32):
        run_notfatal('"%s" /uninstall' % onedrive32)
    if isfile(onedrive64):
        run_notfatal('"%s" /uninstall' % onedrive64)


def uninstall():
    # Rolling back OneDrive disabling in sys env
    registry_delete(HKEY_LOCAL_MACHINE, r"SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\OneDrive", "DisableFileSyncNGSC")


def session_setup():
    # Initializing variables
    user_app_dir = makepath(user_local_appdata, "Microsoft", "OneDrive")
    user_app_path = makepath(user_app_dir, "OneDrive.exe")

    # Killing app before actions
    killalltasks(processes_to_kill)

    # Uninstalling OneDrive in user env
    # "C:\Users\username\AppData\Local\Microsoft\OneDrive\20.143.0716.0003\OneDriveSetup.exe" /uninstall
    if isdir(user_app_dir):
        for setup_dir in glob.glob(makepath(user_app_dir, "**")):
            user_app_setup_path = makepath(setup_dir, "OneDriveSetup.exe")
            if isfile(user_app_setup_path):
                run_notfatal('"%s" /uninstall' % user_app_setup_path)

    # Disabling OneDrive regkey in user env
    registry_delete(HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run", "OneDriveSetup")
    registry_delete(HKEY_CURRENT_USER, r"Software\Microsoft\Windows\CurrentVersion\Run", "OneDrive")
    registry_delete(HKEY_CURRENT_USER, r"Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run", "OneDriveSetup")
    registry_delete(HKEY_CURRENT_USER, r"Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run", "OneDrive")

    # Removing OneDrive remaining files
    if isdir(user_app_path):
        remove_tree(user_app_path)
    remove_user_desktop_shortcut("OneDrive")

d71933e5e338e113e48d003818f86024e33492335c59ff2bcbbb79270c8cf752 : setup.py
7985d44f9fa263dbebd44f6ba8b1579f6a587c9feca55a4d9084e7bb88a3172a : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
6b94896f5cc45f14d83387062cf9d71a3dc53b5a316422c1fa857b1ce7a55b9e : luti.json
7dc8bff2f5413a90ef10524f90f3866db88a4f09b3764e17cbbefc368e2b1184 : WAPT/control