[solved] Appx installieren

Antworten
Kay96
Beiträge: 85
Registriert: 06 Dez 2018, 09:23

[solved] Appx installieren

Beitrag von Kay96 »

Moin zusammen,
ich versuche seit einigen Tagen appx Apps mittels Powershell zu installieren, jedoch bin ich bisher zu keinem positiven Ergebnis gekommen.

Installieren würde ich gerne den xodo PDF Reader, den es leider nur über den Microsoft Store gibt.

Ich habe mir die appx Datei besorgt und kann die App nun mittels powershell installieren.
Als Abhängigkeit möchte ich noch Microsoft.NET.Native.Framework.1.3.appx & Microsoft.NET.Native.Runtime.1.4.appx installieren, damit die App überhaupt lauffähig ist.
Ich habe nun mehrere Lösungsansätze probiert und folgenden Ansatz im Web gefunden (mittels Powershellcall).

Setup.ins:

Code: Alles auswählen

[actions]
requiredWinstVersion >= "4.11.4.3"
; opsi include file
include_append "section_sub_check_exitcode.opsiinc"
setloglevel = 6
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $framework_1_3$
DefVar $framework_1_4$
DefVar $appx$
DefVar $ExitCode$
 
set $ProductId$ = "xodo-pdf-reader"
set $MinimumSpace$ = "300 MB"
set $framework_1_3$ = "Microsoft.NET.Native.Framework.1.3.appx"
set $framework_1_4$ = "Microsoft.NET.Native.Runtime.1.4.appx"
set $appx$ = "Xodo_Windows10_4.0.3.0_x64_ReleaseForStore.appx"

Message "Installing Xodo PDF Reader"
 
if not(HasMinimumSpace ("%SYSTEMDRIVE%", $MinimumSpace$))
	LogError "Not enough space on %SYSTEMDRIVE%: . " + $MinimumSpace$ + " on Drive %SYSTEMDRIVE%: needed for " + $ProductId$ + "."
	isFatalError
else
		comment "show product picture"
		ShowBitmap "%ScriptPath%\xodo_pdf_reader.png" $ProductId$
		
		Message "Installing Xodo PDF Reader"
		
		powershellCall('Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath %scriptpath%\files\'+$framework_1_3$)
		powershellCall('Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath %scriptpath%\files\'+$framework_1_4$)
		powershellCall('Add-AppxProvisionedPackage -SkipLicense -Online -PackagePath %scriptpath%\files\'+$appx$)

endif

Leider wird nichts installiert, hat jemand das Problem schon gelöst?


Liebe Grüße
Zuletzt geändert von Kay96 am 01 Sep 2020, 08:28, insgesamt 1-mal geändert.
Kay96
Beiträge: 85
Registriert: 06 Dez 2018, 09:23

Re: Appx installieren

Beitrag von Kay96 »

Hat keiner eine Idee?
Mir würde jegliche Information helfen :)
feltel
Beiträge: 280
Registriert: 09 Dez 2014, 07:22

Re: Appx installieren

Beitrag von feltel »

Das Add-AppxProvisionedPackage bezieht sich aber nur auf User, die sich nach der Paketinstallation erstmals an der Maschine anmelden. Auf "Bestandsuser" hat das leider keinen Einfluss. Mir ist auch noch keine praktikable Lösung untergekommen und ich versuche die ganze Apps-Sache erstmal zu vermeiden. Einmal brauchte ich eine Lösung, und da hatte ich die Appx-Pakete direkt ins Windows-Installationsimage integriert.
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Appx installieren

Beitrag von SisterOfMercy »

I do not have a solution for the net framework 1.3 and 1.4 packages, but for simple appx packages this works: Download appx package, unpack with 7-zip and just install manually.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Kay96
Beiträge: 85
Registriert: 06 Dez 2018, 09:23

Re: Appx installieren

Beitrag von Kay96 »

Das ist wirklich schade, ich hab noch ein paar andere Wege probiert, aber das war alles irgendwie Mist.
Ich werde nochmal weiter probieren und mich melden, falls etwas sinnvolles dabei rumgekomme ist.
Ansonsten werde ich wahrscheinlich lieber eine andere Software suchen, die nicht nur über den Store verfügbar ist.

Eine Idee wäre eventuell noch, die Befehle über autologin und runonce ausführen, aber das ist immer sehr unschön.
Kay96
Beiträge: 85
Registriert: 06 Dez 2018, 09:23

Re: Appx installieren

Beitrag von Kay96 »

Moin zusammen,
ich habe das Problem jetzt mittels runonce gelöst.
Ich glaube es gibt derzeitig keine "bessere" Lösung.

Setup.ins

Code: Alles auswählen

[actions]
requiredWinstVersion >= "4.11.4.3"
; opsi include file
include_append "section_sub_check_exitcode.opsiinc"
setloglevel = 6
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $appx$
DefVar $tmp$
DefVar $ExitCode$
 
set $ProductId$ = "xodo-pdf-reader"
set $MinimumSpace$ = "300 MB"
set $appx$ = "%ScriptPath%\appx\*.appx"
set $tmp$ = "C:\tmp\appx"

Message "Installing Xodo PDF Reader"
 
if not(HasMinimumSpace ("%SYSTEMDRIVE%", $MinimumSpace$))
	LogError "Not enough space on %SYSTEMDRIVE%: . " + $MinimumSpace$ + " on Drive %SYSTEMDRIVE%: needed for " + $ProductId$ + "."
	isFatalError
else
		comment "show product picture"
		ShowBitmap "%ScriptPath%\xodo_pdf_reader.png" $ProductId$
		
		Message "Installing Xodo PDF Reader"
		Files_copy_appx
		Registry_appx_install /64Bit
		ExitWindows /RebootWanted
		
endif

[Files_copy_appx]
copy -s $appx$ $tmp$

[Registry_appx_install]
openkey [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce]
SET "appx"= REG_SZ:'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -noexit -windowstyle hidden -command "Add-AppxPackage -Path C:\tmp\appx\*;remove-item C:\tmp\appx\ -recurse -force; exit"'
uninstall.ins

Code: Alles auswählen

[actions]
requiredWinstVersion >= "4.11.4.3"
; opsi include file
include_append "section_sub_check_exitcode.opsiinc"
setloglevel = 6
DefVar $ProductId$
DefVar $ExitCode$
 
set $ProductId$ = "xodo-pdf-reader"
 
comment "Show product picture"
ShowBitmap "%ScriptPath%\xodo_pdf_reader.png" $ProductId$
 
if FileExists("%ScriptPath%\delsub.ins")
	comment  "Start uninstall sub section"
	sub "%ScriptPath%\delsub.ins"
endif

delsub.ins

Code: Alles auswählen

; delsub for xodo-pdf-reader

Message "Deinstalling Xodo PDF Reader ..."
 
comment "Deinstallieren..."

Registry_appx_uninstall /64Bit
ExitWindows /RebootWanted

[Registry_appx_uninstall]
openkey [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce]
SET "appx_uninstall"= REG_SZ:'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -noexit -windowstyle hidden -command "Get-AppxPackage *Xodo* | Remove-AppxPackage; Get-AppxPackage *Framework.1.3* | Remove-AppxPackage; exit"'
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: Appx installieren

Beitrag von SisterOfMercy »

Kay96 hat geschrieben: ich habe das Problem jetzt mittels runonce gelöst.
Ich glaube es gibt derzeitig keine "bessere" Lösung.
Ah. An alternative for runonce is the opsi user login scripts. I use that for things when runonce doesn't really work properly.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
djdodo
Beiträge: 164
Registriert: 12 Jan 2011, 10:54

Re: [solved] Appx installieren

Beitrag von djdodo »

Hi Leute,
ein ähnliches Problem habe ich aktuell auch.
Wenn das Paket beim Starten durchläuft passiert nichts (Stichwort: Script running as SYSTEM)

Wenn ich das Script manuell per winst32 laufen lasse geht alles.

Sprich Store-Apps lassen sich nicht als User "SYSTEM" installieren.
Da der Microsoft Store von Anfang an nicht auf dem System ist, muss ich aber etwas tun, der User selbst kann es nicht.
RunOnce liegt auch im Bereich "LOCALSYSTEM", daher wird es auch nicht im User-Kontext ausgeführt.
Dies wird aber z.B. für Microsoft Teams etc benötigt.

Es fehlt mir hier grundlegend eine Lösung.
Eine Option ist es, ein Script mit "Selbst-Löschung" in den Autostart des Default-User-Profils zu legen.

lg
Dodo
Antworten