Writing scripts to x64\<whatever>.exe failed, error code 87

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
DiZzyDmon
Posts: 42
Joined: Mon Aug 06, 2007 11:04 pm

Writing scripts to x64\<whatever>.exe failed, error code 87

Post by DiZzyDmon » Wed Jan 18, 2017 8:59 am

Product: PowerShell Studio 2016 v5.3.131, 64-bit
Operating system: Windows 10 Enterprise version 1607 build 14363.693, 64-bit
PowerShell Version: 5.1.14393.693

This is my first time attempting to package a form using PowerShell Studio.

No matter what form type I choose, no matter what's in it (even if it's entirely empty), when I click Deploy > Build the process fails.

Here's an example of what I get in the Output pane, for a completely empty form:

>> Package 'C:\Users\zepfdp1\Documents\emptyForm.psf'
>> Building (emptyForm.psf) ...
SAPIEN Package and Deploy Tool 4.1 (c) 2005 - 2016 SAPIEN Technologies, Inc.

------ Build started: emptyForm, Configuration: x64 ------
Packaging with SAPIEN PowerShell V2 Host (Windows Forms) x64
Adding C:\Users\Documents\emptyForm.Package.ps1
Error: Writing scripts to x64\emptyForm.exe failed, error code 87, data size: 4278

>> Completed


I uninstalled PowerShell Studio, restarted my computer, reinstalled, no difference.
I uninstalled all Sapien products (I also use PrimalScript, PrimalSQL), restarted, reinstalled just PowerShell Studio, no difference.

I uninstalled all Sapien products, restarted, removed all Sapien and Caphyon folders and registry keys (user and computer), restarted, reinstalled just PowerShell Studio, tried building a generic form, the build completed successfully. I was able to actually add some elements to the form, build successfully.

I reinstalled PrimalScript, PowerShell Studio builds still worked, but only for a few minutes, then I was back to "Error: Writing scripts to x64\<whatever>.exe failed, error code 87, data size: <whatever>"

I again tried uninstalling various Sapien products, reinstalling just PowerShell Studio, etc. The only thing that works is to uninstall all Sapien products, restart, remove all Sapien and Caphyon folder and registry keys, restart, reinstall just PowerShell Studio. Once again it worked for a while, but a few minutes after I reinstalled PrimalSQL (not PrimalScript, like the previous time), builds started failing.

No cure except the complete uninstall and cleanup. I don't know how long that holds stable, because I need to use PrimalScript and PrimalSQL to do my job.

As a test, I installed PowerShell Studio on a loaner laptop (running Windows 7 Enterprise 64-bit), builds worked. I installed PrimalScript, builds worked. I'm going to use PowerShell Studio on this system for today, but I only have use of this loaner until the end of this week.

User avatar
DiZzyDmon
Posts: 42
Joined: Mon Aug 06, 2007 11:04 pm

Re: Writing scripts to x64\<whatever>.exe failed, error code 87

Post by DiZzyDmon » Wed Jan 18, 2017 9:04 am

I've attached the .psbuild form from a failed build (of the form I am actually working on). I had to add an extra .txt file extension to get this website to accept the attachment.
Attachments
SEERestart.psf.psbuild.txt
(1.55 KiB) Downloaded 74 times

User avatar
DevinL
Site Admin
Posts: 1098
Joined: Mon Aug 17, 2015 2:25 pm

Re: Writing scripts to x64\<whatever>.exe failed, error code 87

Post by DevinL » Wed Jan 18, 2017 11:16 am

I'm currently unable to reproduce this on my end.. I've tried adding the psbuild file you gave me to My Documents with a psf file of the same name and built them just fine, with the exception being that I had to modify the icon path.

Can you do a couple things for me?
1) Try a different icon file on your end and see if you can get it to build with a different icon.
2) If this does not solve your issue, can you provide us with the form file and icon that are involved in this?
DevinL
SAPIEN Technologies, Inc.

User avatar
Alexander Riedel
Posts: 7049
Joined: Tue May 29, 2007 4:43 pm

Re: Writing scripts to x64\<whatever>.exe failed, error code 87

Post by Alexander Riedel » Wed Jan 18, 2017 11:31 am

Error code 87 means "The parameter is incorrect", which is Microsoft's way of saying "Something is wrong" Unfortunately that does not help either one of us.

Uninstalling and re-installing rarely solves anything but if this solves it for a few minutes and then it fails again means usually one of four things:
1. Your file system is corrupt
2. You have something running that interferes with opening and writing files.
3. Your windows installation is shot. while everything is still loading, it works. After all is loaded, something gets screwed up.
4. The file is locked by someone when the build process tries to update it

(I know you don't want to hear any one of these things :D)

The last one is the easiest. Try to manually delete the exe file before you build. See if you can actually delete it.
Check running processes if your packaged exe or PSBuild.exe still runs. That would keep your file locked.
Alexander Riedel
SAPIEN Technologies, Inc.