Packager 32 bit vs 64 bit question

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
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
Posts: 3
Joined: Thu Sep 27, 2007 3:18 am

Packager 32 bit vs 64 bit question

Post by »

PrimalScript 2015 7.1.69
64 bit

TLDR; My 32 bit PowerShell packages do not run on 64 bit computers. Is this by design or an error on my part?

I am trying to package a script to be used in a Windows 7 environment with a mix of 32 bit and 64 bit Windows. I have attached a sample of my packager settings. Most computers in the environment only have PowerShell v2.0 installed, so I have to program for the lowest common denominator.

I am finding that my 32 bit version of the package will not execute on 64 bit systems. It "runs", but does not execute the packaged script (no scripted actions performed) and does not return an error message. I am running the scripts elevated.

The same 32 bit version works correctly on a 32 bit computer and the 64 bit version works correctly on a 64 bit computer.

Is this by design or am I misconfiguring in some way?

I have had this problem with both the Sapien V2 Host and the PowerShell Command line engine.

I am including the PowerShell script for reference. FYI, I am using the "$result =" pattern to cut down on output, though when I run the package on a remote computer, I am using the /s command line parameter.

Set-StrictMode -Version 2.0
$ErrorActionPreference = 'SilentlyContinue'

function Main () {
$result = Remove-ItemProperty -Path 'hklm:Software\Microsoft\Windows\CurrentVersion\WindowsUpdate' -Name 'SusClientID' -Force
$result = Remove-ItemProperty -Path 'hklm:Software\Microsoft\Windows\CurrentVersion\WindowsUpdate' -Name 'SusClientIDValidation' -Force
$result = Stop-Service wuauserv
$result = rm c:\windows\SoftwareDistribution -force -recurse
$result = Start-Service wuauserv
$result = wuauclt /detectnow
$successRegKeyPath = 'hklm:Software\company\Infrastructure'
$executionTime = (get-date -format 'yyyy-MM-dd hh:mm:ss')
$result = New-Item -Path $successRegKeyPath -Force
$result = New-ItemProperty $successRegKeyPath -Name "RepairWSUS_Execution" -Value $executionTime -PropertyType String

. Main
$ExitCode = 0
PackagerSettings.png (61.15 KiB) Viewed 4000 times

User avatar
SAPIEN Support Forums
Posts: 945
Joined: Wed Dec 03, 2014 2:26 pm

Packager 32 bit vs 64 bit question

Post by SAPIEN Support Forums »

This is an automated post. A real person will respond soon.

Thank you for posting,

Did you remember to include the following?
  • 1. Product, version and build (e.g. Product: PrimalScript 2014, Version & Build: 7.0.46. Version and build information can be found in the product's About box accessed by clicking the blue icon with the 'i' in the upper right hand corner of the ribbon.)
    2. Specify if you are running a 32 or 64 bit version
    3. Specify your operating system and if it is 32 or 64 bit.
    4. Attach a screenshot if your issue can be seen on the screen
    5. Attach a zip file if you have multiple files (crash reports, log entries, etc.) related to your issue.
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***

User avatar
Alexander Riedel
Posts: 7529
Joined: Tue May 29, 2007 4:43 pm
Answers: 1
Been upvoted: 3 times

Re: Packager 32 bit vs 64 bit question

Post by Alexander Riedel »

I do not know what "My 32 bit PowerShell packages do not run" means. It can mean it runs but does nothing, it crashes, it does not start at all or anything in between.

I see in your script that you use registry keys. Most likely there is your reason. Registry nodes and some file system folders are mapped differently for 32 bit processes on a 64 bit machine. So for your script it probably just looks like a key does not exist because it accesses the 32 bit version of a registry node rather then the 64 bit version.
Alexander Riedel
SAPIEN Technologies, Inc.