Run Preview under Run as Administrator

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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 8 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
scott.fox
Posts: 37
Last visit: Fri May 05, 2017 1:22 pm

Run Preview under Run as Administrator

Post by scott.fox »

Specs:

OS: Windows 8 64bit
PowerShell Studio 2015 Version: 4.2.86

Issue

so im having this issue here with the preview test run.

i have a script im creating that creates a registry key and counts against it 5 times before its forcing you to a 2nd screen..

ive Deleted the registry key that ive created and its contents so it shouldnt see it anymore, but yet in still it moves to the 2nd screen as if it see it there and maxed out

Code: Select all

$strRetryCnt = (Get-ItemProperty HKLM:SOFTWARE\Sage).Count
function Main {
<#
    .SYNOPSIS
        The Main function starts the project application.
    
    .PARAMETER Commandline
        $Commandline contains the complete argument string passed to the script packager executable.
    
    .NOTES
        Use this function to initialize your script and to call GUI forms.
		
    .NOTES
        To get the console output in the Packager (Forms Engine) use: 
		$ConsoleOutput (Type: System.Collections.ArrayList)
#>
	Param ([String]$Commandline)
		
	#--------------------------------------------------------------------------
	#TODO: Add initialization script here (Load modules and check requirements)
	if ($strRetryCnt -eq 5)
	{
		Call-final_psf
	}
	elseif ($strRetryCnt -ne 5)
	{
		Call-MainForm_psf
	}
	#--------------------------------------------------------------------------
	$global:ExitCode = 0 #Set the exit code for the Packager
}

but yet when i go back to the actual editor and do a run in console it shows that it doesn't Exist
[powershell]PS C:\Users\sfox\Documents\SAPIEN\Projects\Office365UI> (Get-ItemProperty HKLM:SOFTWARE\Sage).Count                       
Get-ItemProperty : Cannot find path 'HKLM:\SOFTWARE\Sage' because it does not exist.                                      
At line:1 char:2                                                                                                          
+ (Get-ItemProperty HKLM:SOFTWARE\Sage).Count                                                                             
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                    
    + CategoryInfo          : ObjectNotFound: (HKLM:\SOFTWARE\Sage:String) [Get-ItemProperty], ItemNotFoundException      
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemPropertyCommand                           
                                                                                                                          
0[/powershell]


also the item that Drove me to going in with run as administrator is that its not allowing me to do any registry changes even tho i have the elevated permissions button clicked. is that normal?
User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Thu Oct 22, 2015 1:10 pm

Run Preview under Run as Administrator

Post by SAPIEN Support Forums »

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

Thank you for posting, scott.fox.

Did you remember to include the following?
  • 1. Product, version and build (e.g. Product: PowerShell Studio 2014, Version & Build: 4.1.71. 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
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Run Preview under Run as Administrator

Post by davidc »

The Run Preview command only displays a preview of GUI and doesn't not run any event scripts.

If you want the script to run, just use the Run command [Ctrl + F5] instead of the Preview command.

David
David
SAPIEN Technologies, Inc.
User avatar
scott.fox
Posts: 37
Last visit: Fri May 05, 2017 1:22 pm

Re: Run Preview under Run as Administrator

Post by scott.fox »

thats what im talking about, i didnt mean the Preview GUI...

im talking about the thing that actually Says Run with the green triangle on it.


its acting as if the registry key is added and maxed out when it isnt, but when i do run in console it isnt there all.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Run Preview under Run as Administrator

Post by davidc »

The registry contains has two versions, one for 32 Bit and one for 64 bit.

There is a chance that you are running 32 bit in one process and 64 bit in another. So the key may exist in one platform but not the other.

To delete a registry key you may need admin rights, so try running the script using elevation.

David
David
SAPIEN Technologies, Inc.
This topic is 8 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.