Packaged MSI only copies contained PS1 instead of running it

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 8 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
WSUsoftware
Posts: 30
Last visit: Thu Feb 17, 2022 2:52 pm

Re: Packaged MSI only copies contained PS1 instead of running it

Post by WSUsoftware »

jvierra wrote:
hamsandwich wrote:To clarify this is how my work installs things on computers:
-Get install files from vendors (exe's, MSI's, licenses, etc)
-That gets thrown in a network folder
-A script is written (usually VBS or PS1) that runs the installers as well as any other additional things we want it to do
-That script is thrown in the same network folder
-There is also a ZAP file that is created for each script that is written. That ZAP contains the FriendlyName and SetupCommand.
-For SetupCommand there are two different arguments we use:
---For VBS scripts it is: "C:\Windows\System32\cscript.exe networklocation\script.vbs"
---For Powershell it is: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe networklocation\script.ps1"
-The ZAP file then gets pushed to the control panel, install program from network area using group policy.
-The users just open up the control panel and install programs through the control panel
I think you miss the point of the AP file here. It uses a PS1 to do an install of an exe or other file. You must place you file in the install folder and write a vbs or exe to install the file. You cannot wrap the install script in an exe and have it work as a ZAP installer.
So I should be able to just use the PS1 script that I wrote in the ZAP file as one method of installation, but when I try to do that it doesn't work(a command prompt flashes very briefly, no error message in it).

The alternative based on your previous post is to use an MSI and avoid ZAP files altogether except I don't know how (especially with the MSI installer tool in PSS2015) to make it run the PS1 file instead of just pushing it to a folder.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Packaged MSI only copies contained PS1 instead of running it

Post by jvierra »

You need a vbs or PS1 to install you target file or application. It cannot be the file you are installing.
User avatar
WSUsoftware
Posts: 30
Last visit: Thu Feb 17, 2022 2:52 pm

Re: Packaged MSI only copies contained PS1 instead of running it

Post by WSUsoftware »

This particular PS1 doesn't run an exe or installer file. It is a series of command that Disable or Enable WindowsOptionalFeatures. There was a VBS version for an older operating system that used commands that no longer work in Windows 10, so I wrote a powershell version.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Packaged MSI only copies contained PS1 instead of running it

Post by jvierra »

You cannot run that as a ZAP file. You can use a ZAP file to install it on the remote system. You need to write a scrip fr the ZAP that installs your PS1 file.

You cannot use a script in a zap to install features. YOU can only install the script.

Actually this has nothing at all to do with scripting. It is a systems issue relating to how to use a Windows GP feature to accomplish a distribution task. I recommend posting you issue in the Windows AD/GPO forum as they can help you understand how this is intended to work.
This topic is 8 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked