![]() |
#1 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
Executing .ppkg
I tryed to execute ppkg with multiple sintax : ExecuteWait,ShellExecute,nsExec::ExecToStack
When i execute with nsExec nsExec::ExecToStack 'powershell -inputformat none -ExecutionPolicy Unrestricted -File "$INSTDIR\tempfile.ps1" ' on "tempfile.ps1" i have : Invoke-Item "ppkg_path.ppkg" , nothing happening.My messages are: First : 0(succes) Second: --------------------------- Provisioning OS deployment Setup --------------------------- Invoke-Item : Application not found At C:\Users\Ycos3D\Desktop\Provisioning OS deployment\tempfile.ps1:1 char:1 + Invoke-Item "<ppkg path>" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( ![]() + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.P owerShell.Commands.InvokeItemCommand --------------------------- OK --------------------------- When i execute the command in powershell with the same parameters , the ppkg is running. I tryed ExecWait '"C:\Windows\System32\provtool.exe" "<ppkg_path.ppkg>" ' , nothing happening. When i run same command from cmd , the ppkg is running |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
|
Use the full path to the ppkg.
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
ppkg_path is the full path
|
![]() |
![]() |
![]() |
#4 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 902
|
That's a relative path, like Anders said, use a full (absolute) path. Where are you extracting the file to? That's the full path you should be using.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#5 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
ppkg_path=C:\Users\Ycos3D\Desktop\Provisioning OS deployment\
Is not the full path? In my script is "C:\Users\Ycos3D\Desktop\Provisioning OS deployment\packagename.ppkg" |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
Please try to execute an .ppkg(Provisioning package) file in NSIS.
|
![]() |
![]() |
![]() |
#7 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 902
|
So have you tried it like this:
Is 'ppkg_path' an environment variable? Also, for provtool.exe you should be using $SYSDIR instead of an absolute path. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#8 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
I use 'ppkg_path' just in this thread. in my script is use absolute path. I will try $sysdir for system32.
Please try to execute an .ppkg(Provisioning package) file in NSIS. If you succede , please tell me the script . I executed applications,command lines, powershell expresions,shorcuts, batch and all are running , but i think is a problem with .ppkg in NSIS. |
![]() |
![]() |
![]() |
#9 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 902
|
Ok, this time post the actual code that is failing, and then we can actually try to fix it.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
nsExec::ExecToStack 'powershell -inputformat none -ExecutionPolicy Unrestricted -File "$INSTDIR\tempfile.ps1" '
in tempfile.ps1 ia have just 1 line : Invoke-Item "C:\Users\Ycos3D\Desktop\Provisioning OS deployment\Upgrade_to_Enterprise.ppkg" |
![]() |
![]() |
![]() |
#11 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
|
![]() |
![]() |
![]() |
#12 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 902
|
Alright, so time to start checking that the paths are correct, $INSTDIR\tempfile.ps1 is first. Is tempfile.ps1 being extracted to $INSTDIR? Does the file exist when calling nsExec::ExecToStack? Then in tempfile.ps1 double-check that the path is correct and that it points to a file that exists.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#13 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
the file exist, i used tempfile.ps1 to open a .txt file with same script.
in tempfile.ps1 i had just 1 line : Invoke-Item "C:\Users\Ycos3D\Desktop\Provisioning OS deployment\test.txt" For .txt file (.exe,.pdf and other extensions) works fine. |
![]() |
![]() |
![]() |
#14 |
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 902
|
If nsExec::ExecToStack is returning success, and it's working with other file types, then I would say that it's not a problem with NSIS. You might have to apply the file a different way, ie calling a proper tool to apply the file.
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
![]() |
![]() |
![]() |
#15 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
the powershell script : powershell -inputformat none -ExecutionPolicy Unrestricted -File "C:\Users\Ycos3D\Desktop\Provisioning OS deployment\tempfile.ps1" is working in "Windows Powershell" and the command : "C:\Windows\System32\provtool.exe" "<C:\Users\Ycos3D\Desktop\Provisioning OS deployment\packagename.ppkg>" is working in "Command prompt" but not working in NSIS
The ExecToStack return 0(succes) and the message is : Invoke-Item : Application not found At C:\Users\Ycos3D\Desktop\Provisioning OS deployment\tempfile.ps1:1 char:1 + Invoke-Item "<ppkg path>" + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ( [Invoke-Item], Win32Exception + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.P owerShell.Commands.InvokeItemCommand |
![]() |
![]() |
![]() |
#16 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
The problem is that i can't execute some files from $SYSDIR :changepk.exe , provtool.exe
Other files that require admin acces i can run. I tryed ExecShell "runas" and UAC plugin, but with no result. |
![]() |
![]() |
![]() |
#17 |
Junior Member
Join Date: Jul 2016
Posts: 11
|
Solved!
!include "x64.nsh" ${DisableX64FSRedirection} nsExec::ExecToStack 'powershell -inputformat none -ExecutionPolicy Unrestricted -File "$PLUGINSDIR\tempfile.ps1" ' ${EnableX64FSRedirection} |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|