Enabling app sideloading using NSIS on Windows10 - powershell

I have a Windows Universal App that needs to be sideloaded. I am using NSIS with a powershell script to install it. I would like to have the NSIS installer enable app sideloading in the Windows settings. I have already looked at the documentation from Microsoft about enabling app sideloading (https://msdn.microsoft.com/library/windows/apps/xaml/dn706236.aspx).
If I run the powershell command from the documentation to set the registry in a standalone powershell window it works fine and I can install the app. However, when I put the registry command inside the installer it doesn't work. I have tried using both Powershell and NSIS to set the registry. Using the WriteRegDWORD command from NSIS and the reg add command from Powershell both say that they succeeded. Reading back the values produces the correct value. If I try to set the registry using Set-ItemProperty in the Powershell script it complains that the path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock doesn't exist.
There doesn't seem to be any way to tell whether sideloading is enabled or not from Powershell. Even outside of the installer context checking the registry is not a valid solution because enabling sideloading via Windows Settings doesn't set the registry.
So my current solution is to try to install the app. If the install fails, check the error message and see if it's complaining about sideloading not being enabled. If that is the case then open up Windows Settings to the developer features page and pop up a message saying that sideloading needs to be enabled in order to continue. Then after Windows Settings is closed reattempt to install the app.
Is it possible to enable sideloading from an NSIS installer? Or is it possible to do a check to see if sideloading is enabled or not?

64-bit versions of Windows have a 64-bit and a 32-bit "version" of the registry, this means that what you see in Regedit might not be the same as what a 32-bit application sees.
Use the SetRegView instruction to change the view used by the installer.
Process Monitor is a useful tool to debug registry issues like this...

Related

Powershell started via blueprism does not load installed packages

I am launching PowerShell via blueprism and need to change the expiration date on some users.
I have the packages installed on the machine and can run the code if I open PowerShell outside of the blueprism environment.
Blueprism start location is "C:\Program Files\Blue Prism Limited\Blue Prism Automate"
Local PowerShell starts in network drive "G:" where the packages are installed.
I have tried to change the location, but it does not help.
Elevated permission is not the problem and I have checked that the code works.
This is the error message: Set-ADAccountExpiration : The 'Set-ADAccountExpiration' command was found in the module 'ActiveDirectoryModule', but the module could not be loaded.
EDIT NOTE: I'm launching blueprism via the
application modeler.

Remote debug of Rust program in Visual Studio Code where VSCode sits on Windows

dear Craig McQueen!
I am referring to: Remote debug of Rust program in Visual Studio Code
My config is slightly different that is why I cannot get everything going here:
VScode installed on WIN32 with RUST components successfully!
remote system: odroid C2 ARM64 with UBUNTU18.04 with Kernel 5.14nwith IP: 192.xxx.6.x - user odroid.
I need to remote-compile a Rust program called: c2_mmap_gpio on the OdroidC2
This is already a project on the WIN32.
I did all the steps but it doesn't work.
I think it is not possible to try to run a remote_debug.sh (bash) on a windows machine, right? If yes workaround on this?
I think I need to input my user PWD somewhere to be able to ssh into the remote linux machine, right?
Correct, the remote_debug.sh I described in my answer is good only for a Linux system, and not suitable for a Windows system. For a Windows development system, you would need to write a Windows batch file or Powershell script that provides the equivalent functionality to that remote_debug.sh Bash script.
I'm not proficient in Powershell scripts, and I'm happy using Linux
as my host development machine, so I don't have plans to write such a script.
Regarding needing to enter a password for the SSH operations... Good point. That's something I didn't think to mention in my answer. You need to remove the need for a password to be entered, in one of two ways:
Install your public SSH credentials onto the target, using ssh-copy-id (or the Windows equivalent). Then you should be able to SSH to the target without needing to enter your password.
Give a blank password to the target user on the target, using passwd -d <username>. Note this reduces security, so this is not recommended, especially if the target is accessible via the public Internet.

Is it possible to use Powershell 7 as the debug console version in Visual Studio Code? [duplicate]

What is the difference between [pwsh] and [Powershell Integreted Console] on VS Code?
I usualy use pwsh.
Today, when I installed the powershell extension and then tried to update the powershell, the Powershell Integreted Console started up and found out. What is this?  
pwsh[.exe] is the executable file name of PowerShell [Core] (v6+), the cross-platform edition of PowerShell built on .NET Core / .NET 5+; by contrast, powershell.exe is the executable name of the legacy Windows PowerShell edition (v5.1-), built on the Windows-only .NET Framework (v4.8-)
Windows PowerShell comes with Windows itself, whereas PowerShell [Core] must be installed on demand (on all supported platforms).[+]
VSCode (Visual Studio Code) has an integrated terminal (console) that can run any shell, such as cmd.exe, bash, or pwsh or powershell.
Shells that run in the integrated terminal by default have no special integration with the files being edited. They show by their executable file name in the dropdown list in the integrated terminal's toolbar; e.g.:
By contrast, the PowerShell Integrated Console is a special shell that comes with the PowerShell extension and offers integration with PowerShell code being edited, notably to provide linting and debugging support, among other features.
The PowerShell Integrated Console starts on demand when you first open/activate an editor with PowerShell code in a session, and it shows as follows in the integrated terminal's toolbar:
You can use the PowerShell extension's configuration to choose the specific PowerShell executable to use, which on Windows allows you to choose between running PowerShell [Core] (pwsh.exe) and Windows PowerShell (powershell.exe) in the PowerShell Integrated Console.
If a PowerShell [Core] version is installed and it is installed in a well-known location[*], it will be used by default; the fallback on
Windows is Windows PowerShell. Since PowerShell [Core] versions can be installed side by side, you can switch between different versions, if installed.
If a PowerShell [Core] version in installed in a nonstandard location and is therefore not discovered automatically, you can tell the PowerShell extension where to find it, either via the Settings GUI or via settings.json, as shown in the linked topic and the bottom section of this answer.
Whenever the active tab is a PowerShell source-code file, the status bar in the bottom-right corner shows the PowerShell version that is being used if you however over or click on the {} icon; versions >= 6 imply PowerShell [Core].
If configured, there's a separate icon that directly invokes the PowerShell session menu when clicked and which reflects the active version number - again, see the bottom section of this answer; e.g.:
[+] as of v7.0; time will tell if PowerShell [Core] will ship with future versions of Windows, and perhaps even other platforms.
[*] From the linked docs: "This feature looks at a few well-known paths on different operating systems to discover install locations of PowerShell. If you installed PowerShell to a non-typical location, it might not show up initially in the Session Menu. You can extend the session menu by adding your own custom paths." If you use one of the official installers, the PowerShell extension should find your installation.

Powershell ISE NOT found in Windows Server 2012

i am not able to see the powershell ise application in my windows serevr 2012 OS,Search window .
Below is the screenshot of my issue:
Whats wrong with my OS? Does anything is corrupted?
[ps-ise][1]
[powershellisenotfound][1]
Try to enable powershell via following steps. Open PowerShell Window, and type the following commands:
Import-Module ServerManager
Add-WindowsFeature PowerShell-ISE
For more details see this msdn link.
As far as I know PowerShell ISE is not enabled for WIN server operating systems. Reason: WIN 2012 is designed for headless usage in clouds. Therefore it won't make sense to enable GUI based PowerShell ISE.
I know it's late for the original poster, but it's available to be added as a Feature in the Server Manager. Go to Programs and Features --> Turn Windows features on or off --> Expand Features (in the left pane) --> Add Features (upper right) --> Check the appropriate box in the Add Features Wizard and install.
Note: It's called Windows PowerShell Integrated Scripting Environment (ISE) so it's down in the "W" section and not "P".

How do I run a windows installer via telnet using the trial version?

I'm evaluating install4j in our company.
We build a win32 installer and we are trying to set up a continuous integration environment to test it.
The CI server is able to upload the installer to the windows target machine (which is a virtualized environment) using FTP, and run batch script that looks like
cd c:\tmp\upload\
my_installer.exe -q -varfile response.varfile -console
Currently we're using the trial version of install4j 5.
When the installer is ran from the command line (cmd.exe over remote desktop) I get a popup window that warns about the trial version.
Installation is frozen until I click ok.
When the installer is ran from telnet the command just hangs and never returns. I believe the reason is that popup window.
To fully evaluate install4j we need to be able see how it fits our CI process.
Is there any workaround for this?
This is a restriction of the evaluation version, with a permanent license key the evaluation dialog will not be shown and the problem will go away.