
Reinstall Windows with WADS
Silent install package for Reinstall Windows with WADS
25-7
tis-reinstall-windows-with-wads
Reinstall Windows with WADS
The machine will get ready for deployment
To prevent you from unintentional OS deployments, there are 2 safety features:
- You must remove the
error()
function insidesetup.py
to make the package work. - Deployment will not start unless you click on
Start Deployment
in theOS Deployment
tab. That means you need to export the machine to WADS tab before installing the package : https://www.wapt.fr/en/doc/wapt-wads.html#the-export-selected-hosts-to-wads-button
- package: tis-reinstall-windows-with-wads
- name: Reinstall Windows with WADS
- version: 25-7
- categories: System and network
- maintainer: Simon Fonteneau
- locale: all
- target_os: windows
- architecture: x64
- signature_date:
- size: 8.09 Ko
package : tis-reinstall-windows-with-wads
version : 25-7
architecture : x64
section : base
priority : optional
name : Reinstall Windows with WADS
categories : System and network
maintainer : Simon Fonteneau
description : Warning, Installing this package will reinstall Windows. Please read readme.md.
depends :
conflicts :
maturity : PROD
locale : all
target_os : windows
min_wapt_version : 2.3
sources :
installed_size :
impacted_process :
description_fr : Attention, l'installation de ce paquet réinstallera Windows. Veuillez lire le fichier readme.md.
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule :
editor :
keywords :
licence :
homepage :
package_uuid : fed82886-c2fe-4eab-9c0e-b340cf18cc87
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version :
max_os_version :
icon_sha256sum : f2c39f33ff7df4cf6f12f1050a3653d32cc3a6351fc5c58bd565d386340f2cf8
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date : 2025-06-24T10:02:55.000000
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
signature : Ib5RqVcvrP5y4vBxMBL0xZ8bVpg64NFVI7958HeJFPtsWbtHRDhKi4l/azcBkwqXEAb1mG/+0QQPG4BzKb0WlCgr7nvx9rctdVjP+rILMa74SL8ljpQHEelsfsbTjYorzqF9s58XS1GrdSF5pPZG0d40gH0viTyviL13/t61sNVetJKUX8BEjzbfKXAibL2DeR/d5sWHg7OAbMp0XBteCIzK0SZkU+iqyioNZVzMFmkm67I6c9Vm7m2hfDwK4zN/ZBdTXu9dZeP1A9T4C1pSus0CqKUggFqt4ohjM3lje7gK9e+mB4XOzEhx3JI++Za0I+zRvoss13T9E3tTXsU97A==
# -*- coding: utf-8 -*-
from setuphelpers import *
from common import WaptServer
import platform
name_menu = "Wads Deploy"
guid = "{2bdabb2b-eb21-11ec-ba0b-c85b76537da2}"
loc_folder = "wadswinpe"
loc_systemdrive = systemdrive()
full_loc_folder = makepath(loc_systemdrive, loc_folder)
def install():
if params.get("install_with_luti", False):
return "OK"
error("This package is protected against accidental launches. Please remove this line if you really want to install a new operating system")
if not isdir(full_loc_folder):
mkdirs(full_loc_folder)
if not isfile("boot.sdi"):
update_package(from_setup=True)
filecopyto("boot.sdi", makepath(full_loc_folder, "boot.sdi"))
filecopyto("boot.wim", makepath(full_loc_folder, "boot.wim"))
# TODO INTEGRER DANS LE Boot.wim avec 7zip les drivers déjà existant sur la machine on pourrait même extraire les profiles wifi pour faire un déploiement par wifi
wait_deploy = False
myip = get_main_ip(WAPT.waptserver.server_url.split('//')[1])[0]
for net in [u["mac"] for u in networking()]:
dataipxe = WAPT.waptserver.get("api/v3/get_host_ipxe?mac_address=%s&ip_address=%s" % (net,myip), decode_json=False).decode("utf-8")
if ("wads/winpe/x64" in dataipxe) and (not "registerwinpe" in dataipxe):
wait_deploy = True
break
if wait_deploy:
run(r'bcdedit /create {ramdiskoptions} /d "%s"' % name_menu)
run(r"bcdedit /set {ramdiskoptions} ramdisksdidevice partition=%s" % loc_systemdrive)
run(r"bcdedit /set {ramdiskoptions} ramdisksdipath \%s\boot.sdi" % loc_folder)
run(r'bcdedit /create %s /d "%s" /application OSLOADER' % (guid, name_menu))
run(r"bcdedit /set %s device ramdisk=[%s]\%s\boot.wim,{ramdiskoptions}" % (guid, loc_systemdrive, loc_folder))
run(r"bcdedit /set %s osdevice ramdisk=[%s]\%s\boot.wim,{ramdiskoptions}" % (guid, loc_systemdrive, loc_folder))
run(r"bcdedit /set %s systemroot \windows" % guid)
run(r"bcdedit /set %s winpe yes" % guid)
run(r"bcdedit /set %s detecthal yes" % guid)
run(r"bcdedit /displayorder %s /addlast" % guid)
run(r"bcdedit /default %s" % guid)
run(r"bcdedit /timeout 5")
run("shutdown /f /r /t 0")
else:
print("Please prepare and start a deployment for this computer in the OS Deployment tab before installing this package")
print("Skipping Installation")
def update_package(from_setup=None):
urlserver = WAPT.waptserver.server_url
old_version = control.get_software_version()
if not from_setup == True:
WAPT.waptserver.client_certificate = None
WAPT.waptserver.client_private_key = None
with WAPT.waptserver.get_requests_session() as session:
wget("%s/wads/winpe/x64/media/Boot/boot.sdi" % (urlserver), "boot.sdi", requests_session=session)
wget("%s/wads/winpe/x64/media/sources/boot.wim" % (urlserver), "boot.wim", requests_session=session)
if not from_setup == True:
version = control.version.split("-")[0]
version_package = str(int(control.version.split("-")[1]) + 1)
control.version = version + "-" + version_package
control.save_control_to_wapt()
def uninstall():
if isdir(full_loc_folder):
remove_tree(full_loc_folder)
889efc444fa2f381f8e1cf6442539d03aad16b62d5e382f086b8d8dc400875ed : WAPT/README.md
94cad6f2086ac3367cea725a954925d9778a2a80fa88969ffc432645b6306c71 : WAPT/README_fr.md
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
76669b0bd3a76467ca262e459a66986dde26eeb2fdc0ab3a74d47d0e898d8a96 : WAPT/control
f2c39f33ff7df4cf6f12f1050a3653d32cc3a6351fc5c58bd565d386340f2cf8 : WAPT/icon.png
f5daf9f430227080a4a9fac72e267c3d7cff2dc15dd854dbbeb39635ab77f3ac : luti.json
561f28676f2792820b46b7ae918e97950af55e72dfd260689a8aa91fbc72023d : setup.py