Situation:
wenn ich die BAT-Datei auf dem Client mit Administratorrechten ausführe, wird diese installiert. Wenn ich diese via Matrix42 ausführen lasse, wird diese laut Log erfolgreich installiert, aber die Software ist nicht vorhanden.
Vorgabe:
Ich habe ein Softwarepaket, welches eigentlich eine Microsoft Store App ist, vom Hersteller wird als Alternative ein Download mit Powershell Verteilungsscripts angeboten. Ich habe eine BATCH Datei welche die Installation ohne Probleme auf einen Client ausführt. Was würdet ihr machen um die Situation sauber zu lösen? Ich hatte versucht den Inhalt direkt über die Setup.inf zu lösen, jedoch muss folgendes abgearbeitet werden.
1. Windows Developer Modus aktivieren
2. Zertifikat installieren
3. Powershell ausführen (welches ein weiteres Powershell ausführt)
4. Nach der Installation den Windows Developer Modus deaktivieren
Install.BAT
Code: Select all
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
certutil -addstore -user TrustedPeople .\Install.cer
powershell.exe -executionpolicy bypass -file "%~dpn0.ps1" -force
timeout 30 > nul pause
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "0"
Setup.inf
Code: Select all
[SetupInfo]
Author = Autorname
CreationDate = 15.06.2023
InventoryID =
Description = Produkt AG - Produkt
Method = scripted
Tested on = Win10
Dependencies =
Command line options = /S2 /AW
Last Change = 22.06.2023 14:07
Build =
;[VarDefInfo]
; <Variable>, <Type: 0=Computer 1=User>, <Allow NULL values: 0=No 1=Yes>
[Setup]
Version=15.0
ShowCaption=1
BlockInput=0
Platform=*
[Requirements]
[Application]
ProductName=Produkt
DeveloperName=Produkt AG
Version=1.0
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName% %Version%", Arial, 30, , 000000, 4, , LEFT BOLD ITALIC
Text2="%DeveloperName%", Arial, 24, , 000000, 4, , LEFT BOLD ITALIC
Text8="%Company%", Arial, 18, , 000000, 4, 10, RIGHT BOLD ITALIC
Text9="%InstallationFor% %WindowsUser%", Arial, 16, , 000000, 4, -18, BOTTOM ITALIC LEFT
BackgroundColor=00B6FF,FFFFFF
CopyDialogRect=0%, 77%, 100%, 100%, HCENTER
; Register all installations in common registry key
UserKeyName=%DeveloperName%\%ProductName%
MachineKeyName=%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=%DeveloperName% %ProductName% %Version%
UninstallDisplayName=%ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
UninstallDisplayIcon="%ApplicationDir%\%SetupInfDir%\setup.ico",0
;UninstallOptions=NOREMOVE NOREPAIR NOMODIFY
ReinstallMode=1
HideUninstall=0
SrcDir=..
ApplicationDir=%ProgramFilesDir%\Empirum\%Developername%\%ProductName%\%Version%
SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=0
ShellLinks=1
CommonShellLinks=1
CreateUnresolvableShellLinks=1
UseStringSection=Strings:09
UseSysStringSection=SysStrings:09
DateWarning=1
SizeWarning=0
Reboot=0
PreventExternalReboot=1
StartServicesOnReboot=0
CallTimeOut=3600
AbortAfterCallTimeOut=1
DisableCancelButton=1
ShowEndMessage=1
EndMessage=%EndMessageDesc%
[Strings:07]
Disk1=Installationsmedium 1
EndMessageDesc=Die Installation wurde erfolgreich abgeschlossen!
ErrorLogMessage=Die Installation/Deinstallation wurde mit einer Fehlermeldung abgebrochen!
InstallationFor=Installation für:
InstallerDesc=Dienstprogramm zum Installieren einzelner Komponenten.
InstallerName=Installationsprogramm
SetupWizard=Installations-Assistent
Uninstallation=deinstallieren
ErrorText=Fehler
CallingText=beim Aufruf von
[Strings:09]
Disk1=Installation media 1
EndMessageDesc=Installation was completed successfully!
ErrorLogMessage=The installation/uninstallation aborted with an error message!
InstallationFor=Installation for:
InstallerDesc=Service program to install single components.
InstallerName=Setup program
SetupWizard=Installation Wizard
Uninstallation=Uninstallation
ErrorText=Error
CallingText=launching
[SysStrings:07]
Users=Benutzer
[SysStrings:09]
Users=Users
[Environment]
ReInstSuccessMessage1031=Die Konfiguration wurde erfolgreich abgeschlossen.
ReInstSuccessMessage1031_1=Die Konfiguration wurde abgeschlossen.
ReInstSuccessMessage1033=Configuration completed successfully.
ReInstSuccessMessage1033_1=Configuration completed.
LogFileFolder=%ProgramData%\Matrix42\Logs\%ProductName%
LogFile=%LogFileFolder%\Log_%ProductName%.%Version%.%Revision%.log
CommonSetupDir=%CommonFilesDir%\Setup%SetupBits%
Uninstallkey=Produktname
V_MachineValuesPath=\\%EmpirumServer%\Values$\MachineValues\%DomainName%
V_UserValuesPath=%HKLM,"Software\matrix42\Software Depot","HomeServer"%\Values$\UserValues\%UserDomain%
RegUninstallKey=HKLM,Software\Microsoft\Windows\CurrentVersion\Uninstall\%Uninstallkey%,UnInstallString
DisplayVersion=1
DetectedDisplayVersion=%%HKLM,Software\Microsoft\Windows\CurrentVersion\Uninstall\%Uninstallkey%,DisplayVersion%%
Erfolg=0
Counter=0
; Maschinenabhängige Variablen
; machine dependent variables
;VM_<Variable>=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,<Variable>%%
; Userabhängige Variablen
; user dependent variables
;VU_<Variable>=%%%V_UserValuesPath%\%WindowsUser%.ini,%WindowsUser%,<Variable>%%
; !!! Setzen der entsprechenden ReplaceEnv Befehle für die Variablen im Abschnitt [Product] nicht vergessen!!!
; !!! Don't forget to set the appropriate ReplaceEnv instructions for the variables in the section [Product]!!!
[Encryption]
[Disks]
1=%Disk1%
[Options]
Installer = %InstallerName%, COPYALWAYS, Installer, "%InstallerDesc%"
Product = %ProductName%, COPYALWAYS, Product, "%ProductDesc%"
[Installer]
1:..\..\..\..\User\Setup.exe, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\SetupDeu.chm, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\User\SetupEnu.chm, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:%SetupInfDir%\Setup.inf, , NORMAL, 0
1:%SetupInfDir%\Install.cer, , NORMAL, 0
1:%SetupInfDir%\Install.ps1, , NORMAL, 0
1:%SetupInfDir%\Add-AppDevPackage.ps1, , NORMAL, 0
1:%SetupInfDir%\Uninstall.ps1, , NORMAL, 0
1:%SetupInfDir%\Install.bat, , NORMAL, 0
;1:%SetupInfDir%\setup.ico, , NORMAL, 0
1:%Temp%\Setup64.exe, %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64, 0
[FileCheckMachine]
ReplaceEnv V_MachineValuesPath
If DoesFileExist ("%V_MachineValuesPath%\%ComputerName%.ini") == "0" Then "FileIsntThere" EndIf
[FileCheckClient]
ReplaceEnv V_UserValuesPath
If "%UserDomain%" <> "%ComputerName%" Then "CheckClientFile" EndIf
[CheckClientFile]
If DoesFileExist ("%V_UserValuesPath%\%WindowsUser%.ini") == "0" Then "FileIsntThere" EndIf
[FileIsntThere]
ErrorLogMsg Values$\MachineValues\%DomainName%\%ComputerName%.ini or Values$\UserValues\%UserDomain%\%WindowsUser%.ini not found!
Abort
[Product]
#Set:Installation, DONTDELETE CLIENT
#Ini:Product
#Reg:Product
#check:Deinstallation, DELETE
#Reg:OnUninstallProduct, DELETE
[Set:Installation]
MD "%LogFileFolder%"
Sleep 10000
CallHidden cmd /c "%SetupInfDir%\Install.bat"
Sleep 10000
[AbortUser]
ErrorLogMsg "Desktopverknüpfung wurde nicht erstellt."
Abort
[AbortMSIUnInst]
-Abort
-ErrorLogMsg %ErrorLogMessage% ErrorLevel: %ErrorLevel%
[SET:ChangeMSISourcelist]
ReplaceRegValue (HKCR,"Installer\Products\%V_MSIInstallerID%\Sourcelist","LastUsedSource","\\%EmpirumServer%","\\%%EmpirumServer%%", 1)
ReplaceRegValue (HKCR,"Installer\Products\%V_MSIInstallerID%\Sourcelist\Net","1","\\%EmpirumServer%","\\%%EmpirumServer%%", 1)
[Security:Product]
[Shell:Product]
[Set:Deinstallation]
-Sleep 10000
-Callhidden powershell.exe -file "%app%\Uninstall.ps1" -Logfile '%Logfile%'
-powershell.exe -command "{Get-AppxPackage *SoftwareName* | remove-appxpackage}"
-AddMeter -1
-Sleep 3000
[check:Deinstallation]
IF DoesRegKeyExist ("HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*SOFTWARENAME*\Application\ApplicationName") == 0 Then "Set:Deinstallation" EndIf
[Set:DeInstallationError]
-Abort
-ErrorLogMsg %ErrorText% %ErrorLevel% %CallingText% bei Deinstallation Produkt
[Reg:OnUninstallProduct]
HKLM,"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Produktname","Systemcomponent",0x00010001,"0x00000001"
-HKLM,"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Produktname"
[Reg:Product]
HKLM,"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Produktname","Systemcomponent",0x00010001,"0x00000001"
[Ini:Product]