Create-EXEFromPS1 icon indicating copy to clipboard operation
Create-EXEFromPS1 copied to clipboard

Powershell script not found

Open ThomasRunting opened this issue 8 years ago • 10 comments

Ive packaged my ps1 and a supp folder but when the post install cmd runs powershell complains it cant find the ps1 scipt in the correct temp folder. @nickrod518

ThomasRunting avatar Apr 27 '17 01:04 ThomasRunting

Can you provide the command you used to create the exe?

nickrod518 avatar Apr 27 '17 15:04 nickrod518

Create-EXEFrom.ps1 -PSScriptPath .\exam-setup.ps1 -SupplementalDirectoryPath .\Scripts\ -x64 -Verbose

It seems like the installer deletes the tmp folder before the post install cmd runs. Iam ussin this on win10 x64 if that helps

ThomasRunting avatar Apr 28 '17 00:04 ThomasRunting

So is the missing file error coming from not being able to find exam-setup.ps1, or another script within the .\Scripts\ directory?

nickrod518 avatar Apr 28 '17 12:04 nickrod518

%userprofile%\Temp\IPX000TMP\exam-setup.ps1 %userprofile%\Temp\IPX000TMP\Scripts"Extra things in here" It deletes the IPX000TMP folder before powershell can find the exam-setup.ps1 file

ThomasRunting avatar May 01 '17 03:05 ThomasRunting

Very odd, I'm unable to reproduce. I am also on Windows 10 x64. My test was to create a test.ps1 script that pauses after listing doing Get-ChildItem on the supplementary directory. I tried this with and without the -x64 switch. In both cases, the supplementary directory remained until I resumed from the pause, when it was deleted after the script finished.

Can you try using full path names in the command and see if that makes a difference?

How are you able to confirm the temp folder gets created in the first place?

nickrod518 avatar May 01 '17 12:05 nickrod518

Ive done some screen caps when i run the finished exe. vid 1 vid 2 vid 3 vlcsnap-2017-05-02-09h18m55s103 you mite need to slow down the vids

ThomasRunting avatar May 01 '17 23:05 ThomasRunting

That is very odd. So one thing that sticks out is when the CMD window returns "No Instance(s) Available." and then lists the command it runs in the postinstall to initiate the script. Is the tone that comes after from UAC or is there an off-screen error? The only thing I can think of to try is manually recreating that temp folder, move your contents to it, and then try running the CMD in that window to see if some error is returned. Sorry, I don't really have any ideas and can't replicate the issue.

nickrod518 avatar May 02 '17 12:05 nickrod518

I know this is a little bit old, but I was able to reproduce this behavior. I was seeing the same thing when the script and supplemental directory were both on a USB flash drive. When performed on a .ps1 and directory that were on an internal drive (literally copied to internal from the flash drive) it worked just fine.

SymmetryInter avatar Apr 22 '20 14:04 SymmetryInter