OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Antworten
Opsi_Novice.fr
Beiträge: 11
Registriert: 17 Aug 2023, 18:01

OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Beitrag von Opsi_Novice.fr »

Hello,

I'm encountering issues while creating packages for manual deployment on target client machines. My clients are running Windows 11, and the setup files (.exe) that I want to deploy are in that format. I've successfully managed to deploy the application to the target PCs using Opsi config editor. However, I'm facing a problem when it comes to uninstalling the deployed application.

Typically, with an .msi installer, the uninstallation process works smoothly. However, I've been tasked with finding a solution to deploy a .exe application in a way that allows manual deployment on a client and ensures proper uninstallation.

The current scenario is as follows: In Opsi config editor, the uninstallation status is marked as successful, but when I check on the target computer, the application is still installed.

I would appreciate your advice and suggestions regarding possible solutions to address this issue. Do you have any insights on how to proceed or any online resources I could refer to for finding an appropriate solution?

Thank you in advance for your feedback.

Best regards,
Patrick
Benutzeravatar
SisterOfMercy
Beiträge: 1524
Registriert: 22 Jun 2012, 19:18

Re: OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Beitrag von SisterOfMercy »

Read the opsi script manual. Try out the opsi setup detector.
Some programs are easy, some have a shitty installer. Some are installed per user because the maker of the program isn't very smart.

Tell us what the software is that you're trying to install, and show the script you have.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Opsi_Novice.fr
Beiträge: 11
Registriert: 17 Aug 2023, 18:01

Re: OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Beitrag von Opsi_Novice.fr »

Hello SisterOfMercy,

Thank you for your response and insights.

The software I'm trying to deploy is notepad++.exe. Here are the details I entered during package creation:

Configuration File: Z:\Note_pad\npp.8.5.4.x64.exe
Software Version: 8.5.4.0
Installation Directory: C:\Program Files\Notepad

Autonomous Installation Command: "%scriptpath%\files1\npp.8.5.4.x64.exe" /S

Default
Autonomous Uninstallation Command: "$Installdir$\uninstall.exe" /S

With modified options
Autonomous Uninstallation Command: "$Installdir$\uninstall.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART

Uninstall Program: uninstall.exe


Despite setting the autonomous uninstallation command with modified options, I'm still facing an issue where the uninstallation status shows as successful in Opsi config editor, but the application remains installed on the target computer. I'm seeking guidance to ensure proper uninstallation.

Any suggestions or insights would be greatly appreciated.

Would you need me to copy and provide you with the uninstall.opsiscript script ?

Code: Alles auswählen

; This is a opsi-script file.
; See https://opsi.org    https://uib.de
; This code was originally created by opsi-setup-detector 4.2.0.8
; ----------------------------------------------------------------
encoding=utf8


[Actions]
requiredWinstVersion >= "4.12.0.28"
ScriptErrorMessages = false

; All variables are defined here:
include_insert "define_vars_multi.opsiscript"

; import complete file !
importlib "uib_exitcode.opsiscript"
importlib "osd-lib.opsiscript"


; ----------------------------------------------------------------
; $ProductId$ is the name of the product in opsi, only lower letters, no umlauts, no white spaces, use '-' as a seperator
Set $ProductId$		 = "notepad"
; the path where we find the product after the installation
Set $InstallDir$	= "%ProgramFiles32Dir%"
Set $LicenseRequired$ = "False"
Set $LicensePool$	  = ""
; ----------------------------------------------------------------

set $OS$ = GetOS

if not(($OS$ = "Windows_NT"))
	logError "Installation aborted: wrong OS version: only Windows"
	isFatalError "wrong OS"
endif


comment "Show product picture"
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$



Message "Uninstalling " + $ProductId$ + " ..."

if FileExists("%ScriptPath%\delsub.opsiscript")
	comment "Start uninstall sub section"
	Sub "%ScriptPath%\delsub.opsiscript"
endif

if $LicenseRequired$ = "true"
	comment "Licensing required, free license used"
	Set $tmpstr$ = FreeLicense($LicensePool$)
endif

Best regards,
Patrick
Benutzeravatar
SisterOfMercy
Beiträge: 1524
Registriert: 22 Jun 2012, 19:18

Re: OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Beitrag von SisterOfMercy »

Opsi_Novice.fr hat geschrieben: 18 Aug 2023, 08:48 The software I'm trying to deploy is notepad++.exe. Here are the details I entered during package creation:
I think this is also available as an abo+ package from uib.
Opsi_Novice.fr hat geschrieben: 18 Aug 2023, 08:48 Default
Autonomous Uninstallation Command: "$Installdir$\uninstall.exe" /S

With modified options
Autonomous Uninstallation Command: "$Installdir$\uninstall.exe" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART

Uninstall Program: uninstall.exe[/b]

Despite setting the autonomous uninstallation command with modified options, I'm still facing an issue where the uninstallation status shows as successful in Opsi config editor, but the application remains installed on the target computer. I'm seeking guidance to ensure proper uninstallation.
I think that notepad++ uses the nsis installer. So this would be correct: "$Installdir$\uninstall.exe" /S
The uninstall line with /verysilent looks to be from innosetup.

The script you shown is missing at least some form of setup. It needs a winbatch section. And with a /64Bit parameter if you are installing the 64-bit version of notepad++.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Opsi_Novice.fr
Beiträge: 11
Registriert: 17 Aug 2023, 18:01

Re: OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Beitrag von Opsi_Novice.fr »

When notepad++ is installed, an uninstall executable is created in the program files folder. I can't figure out during package creation how the standalone uninstall command points to the uninstall.exe.

I have this standalone uninstall command: $Installdir$\uninstall.exe" /S

If I've understood correctly, it will look for the uninstall.exe in its installation folder, but I don't understand why when I request the uninstall nothing happens on the target machine, but on opsi config editor it tells me that the uninstall was successful.

Remember that I'm new to opsi.

Translated with www.DeepL.com/Translator (free version)
Opsi_Novice.fr
Beiträge: 11
Registriert: 17 Aug 2023, 18:01

Re: OPSI Package: Deploying setup.exe and Uninstall.exe on Windows 11

Beitrag von Opsi_Novice.fr »

I was successful for the standalone uninstall.

All I had to do was change the path with variable to the absolute path where the uninstall.exe is located when creating the package in the "standalone uninstall command" section.
Antworten