Page 1 of 1

Packager 32 bit vs 64 bit question

Posted: Tue Oct 06, 2015 8:02 am
by brbedgood@gmail.com
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

Packager 32 bit vs 64 bit question

Posted: Tue Oct 06, 2015 8:02 am
by SAPIEN Support Forums
This is an automated post. A real person will respond soon.

Thank you for posting, brbedgood@gmail.com.

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 ***

Re: Packager 32 bit vs 64 bit question

Posted: Tue Oct 06, 2015 8:45 am
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.