Support Forums

Packaged MSI only copies contained PS1 instead of running it

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.
User avatar
hamsandwich
Posts: 14
Joined: Thu Nov 20, 2014 12:05 pm

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

Postby hamsandwich » Tue Feb 16, 2016 2:30 pm

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.
User avatar
jvierra
Posts: 9698
Joined: Tue May 22, 2007 9:57 am
Contact:

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

Postby jvierra » Tue Feb 16, 2016 2:58 pm

You need a vbs or PS1 to install you target file or application. It cannot be the file you are installing.
User avatar
hamsandwich
Posts: 14
Joined: Thu Nov 20, 2014 12:05 pm

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

Postby hamsandwich » Tue Feb 16, 2016 3:07 pm

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.
User avatar
jvierra
Posts: 9698
Joined: Tue May 22, 2007 9:57 am
Contact:

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

Postby jvierra » Tue Feb 16, 2016 3:15 pm

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.

Return to “Windows PowerShell”

Who is online

Users browsing this forum: No registered users and 9 guests