MSIX: Set Installation Path - msix

How to change the MSIX installation path??
Referred this url - "https://learn.microsoft.com/en-us/windows/msix/desktop/desktop-to-uwp-behind-the-scenes"
Always installer package is created in default location "C:\Program Files\WindowsApps"
Need to set the installer location to different location.

The installation path of an MSIX package cannot be changed. All the files you have included in your package are installed inside an app-specific folder under "C:\Program Files\WindowsApps<your app>\".
This is a design decision from Microsoft. Only for MSI/EXE installers you can change the install path.
If you want to add files in other folders too, you need to copy them the first time your application is launched. For that, you have multiple options. You can write your own code inside your application to copy the files in other folders or you can use tools like Advanced Installer to do it for you.
To understand more about MSIX and how files outside of the installation path can be managed I recommend this article/presentation I wrote last month.

Related

How compile uic with PySide6

I want to compile uic to PySide6 but I don't find how to install pyside6-uic tool. Where can I install pyside6-uic? I downloaded PySide6 but command pyside6-uic doesn't work.
There is a reference here in the title:
https://doc.qt.io/qtforpython/tutorials/basictutorial/uifiles.html#using-ui-files-from-designer-or-qtcreator-with-quiloader-and-pyside6-uic
Step 1. If you installed PySide6
a. In a venv then go to your venv's folder.
b. Globally then go to your python installation folder.
Step 2. Go to Lib then site-packages then PySide6.
Step 3. Copy uic.exe ( or uic if the file extension are hidden) create a folder called bin and paste what you've copied inside it.
To compile ui files from:
QtDesigner: From the top menu select Form -> View Python Code... then click on the save icon (floppy disk) from the newly opened window.
Command Prompt: pyside6-uic.exe mainwindow.ui > ui_mainwindow.py
PowerShell: pyside6-uic.exe mainwindow.ui -o ui_mainwindow.py
If you using virtual environment, when you install pyside6 with pip in the virtual environment there is a folder named Scripts there is the pyside6-uic.exe tool.
if you have install pyside6 globally in your system and you use visual studio code you can use the extension PySide2-vsc then when you installed you can go to preferences > settings and search the PySide2-vsc extension settings then look for the "Command to compile a .ui file into python". Then you can use that feature with right-click on .ui files.
I could solve this issue to add this Path to my %PATH% Variable on windows.
C:\Users\<YOUR_USER_PATH_NAME>\AppData\Roaming\Python\Python311\Scripts
The pyside6-uic tool is supposed to be installed automatically when installing the Python package.
Check if uic is in PATH
When using loadUiType, the Qt documentation (here) states that :
The internal process relies on uic being in the PATH. The pyside6-uic
wrapper uses a shipped uic that is located in the
site-packages/PySide6/uic, so PATH needs to be updated to use that if
there is no uic in the system.
But even then, I got the following error :
Cannot run 'pyside6-uic': "execvp: No such file or directory" -
Exit status QProcess::NormalExit ( 255 )
Check if 'pyside6-uic' is in PATH
For me, pyside6-uic was not located in site-packages/PySide6/uic. When reinstalling the module with pip, I noticed this message :
WARNING: The scripts pyside6-assistant, pyside6-designer, pyside6-genpyi,
pyside6-linguist, pyside6-lrelease, pyside6-lupdate, pyside6-rcc and pyside6-uic are
installed in '/Users/<user>/Library/Python/3.8/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning,
use --no-warn-script-location.
So make sure to add the right directory to your $PATH variable.
Once it's done, you will be able to use the pyside6-uic command to generate a Python class from a UI file :
pyside6-uic mainwindow.ui > ui_mainwindow.py
Loading a .ui from code
You can also load a .ui file from your code using either:
loadUiType (doc page) :
This function generates and loads a .ui file at runtime, and it
returns a tuple containing the reference to the Python class, and the
base class.
or QUiLoader (doc page):
enables standalone applications to dynamically create user interfaces
at run-time using the information stored in UI files or specified in
plugin paths
from PySide6.QtUiTools import QUiLoader
ui_file = QFile("mainwindow.ui")
ui_file.open(QFile.ReadOnly)
loader = QUiLoader()
window = loader.load(ui_file)
window.show()
Generally speaking, use absolute paths to access your UI files. Relative paths are susceptible to errors.

Can you use Java JPackage to create own Windows installer without using its way of running application

Background, I currently use Izpack for my Windows installer, I bundle a java runtime and use winrun4j as a wrapper both for the installation and the actual program once installed. It worked for a long time but there are a number of problems with the installer that I have not been able to solve and have been looking to replace it.
Oracle now provide the JPackage installer so it seems like a sensible choice. But the folder structure created by the installer is different to what I currently have, I have a number of config and non java files and I have not been able to get the .exe that JPackage creates to do anything.
So is it possible to use JPackage to create the installer but in a strcuture better matching my existing structure, and use continue to use WInRun4j to actyally run my application
Existing Folder Structure
ROOT
---App.exe
---Config Files
---lib
-------jar files
---JVM64
------- Java runtime
---help
JPackage structure
ROOT
---App.exe
---Runtime Dlls
---app
----- jar files
Config files
--runtime
------Java runtime
------Runtime Dlls (again)
The structure of directories generated by jpackage is mainly set up for you and does not seem possible to change, and makes installation of Java app dependencies very easy with self contained JRE. The basic structure for Windows is as you say:
ROOT
---App.exe (for --main-class parameter)
---xyz.exe (for each --add-launcher parameter)
---Runtime Dlls (these appear to be unused except for applauncher.dll, see SO 62607300)
---app/
------App.cfg (for --main-class)
------xyz.cfg (for per --add-launcher)
---runtime/
------Java runtime
------Runtime Dlls
With --input and --main-jar params you are free to setup additional directory structure under app/ folder for anything else you want for your application. So if you used lib/myappjar.jar it would add:
---app/
-------lib/
----------myappjar.jar
If you used --input build\mypath it would copy the entire tree of files under that folder, so if build\mypath dir contained
bin/
---Scripts
---xyz.properties
README.txt
Then app would also contain:
---app/
------bin/
---------Scripts
---------xyz.properties
------README.txt
By the way the Runtime DLLs placed at top level appear to be copies of some of the DLLs under runtime/bin
[https://stackoverflow.com/questions/62607300/why-is-java-jpackage-installing-windows-dll-files-in-two-places]

Deploying MVC project to remote iis server with Umbraco

I'm running into an issue where I'm trying to publish through Visual Studio, but publishing the site doesn't copy out the App_Data folder, which causes the site to crash when it's run, because it's trying to write to a file that doesn't exist. To remedy this, I figured I could just manually copy out the App_Data folder, which did help, however there are still files not present, for example this is my current error:
C:\inetpub\wwwroot\myapp\App_Data\TEMP\PluginCache\umbraco-plugins.{machine-name}.hash' is denied
Which tells me that Umbraco isn't writing out the new files for the remote machine it's now running on. My question then is, how do I get Umbraco to generate all the files it needs to generate to run properly?
Make sure you have the correct file permissions set that are required by Umbraco:
/Web.config Modify / Full control
Only needed for setting database and version Information during installation. So can be set to read-only afterwards for enhanced security
/App_Code Modify / Full control
Should always have modify rights as the folder and its files are used for dynamically loading in and generating dlls
/App_Data Modify / Full control
Should always have modify rights as the folder and its files are used for cache and storage
/Bin Modify / Full control
Needed for installing packages, if no packages are installed, this can be set to read accees only
/Config Modify / Full control
Only needed for setting database and version Information during installation. So can be set to read-only afterwards for enhanced security
/Css Modify / Full control
Should always have modify rights as the folder and its files are used for css files
/MacroScripts Modify / Full control
Should always have modify rights as the folder and its files are used for Razor files
/Masterpages Modify / Full control
Should always have modify rights as the folder and its files are used for template files
/Media Modify / Full control
Should always have modify rights as the folder and its files are used for media files uploaded via Umbraco cms interface
/Scripts Modify / Full control
Should always have modify rights as the folder and its files are used for script files
/Umbraco Modify / Full control
For upgrades and package installation, it should have modify rights, but can be set to read-only afterwards
/Umbraco_client Modify / Full control
For upgrades and package installation, it should have modify rights, but can be set to read-only afterwards
/UserControls Modify / Full control
Modify rights are needed for installing packages
/Views Modify / Full control
Should always have modify rights as the folder and its files are used for template, partial view and macro files
/Xslt Modify / Full control
Should always have modify rights as the folder and its files are used for macro files
Figured it out, first off in App_Data, remove everything in there except packages, then go into iis and on your site, right click, edit permissions -> Security tab -> edit -> Add -> Add the name of the site (myapp, myapp.com, etc.), give full control, and your problem should be solved, the site will be able to generate any files it needs to generate.

Using LibGit2Sharp in the Mono ASP.NET MVC project on Ubuntu

I've created ASP.NET MVC project in MonoDevelop on Ubuntu.
Using Nuget, I added LibGit2Sharp package, but it doesn't have libgit2 library compiled for linux environment.
Then I downloaded libgit2 sources and compiled them.
Now I have libgit2-06d772d.so, but when I put it into the bin folder of my asp.net mvc project, I get System.DllNotFoundException git2-06d772d
NOTE
When I create Console project and put libgit2-06d772d.so into the bin folder of this project, application works fine.
Shared objects are not loaded when they are next to a particular file, but when their directory is in the library load path. The operating system sets a few paths that are valid for all programs, but if you have your library elsewhere, you need to specify the directory yourself.
Exporting LD_LIBRARY_PATH with the dir of the library will let the library loader know what other paths you expect to load a library from. E.g. if you built libgit2 with the libgit2sharp script you might run
export LD_LIBRARY_PATH=$HOME/libgit2sharp/libgit2/build
in the console to let the OS know that any program you start from that shell where to find libgit2.
It's common for mono-based apps to provide a script for the user to run which sets up the environment before calling mono to start the actual .exe with the program.

Can i run Erlang without local admin rights on Windows?

I have a machine which doesn't give me local admin rights. Is it still possible to run erlang on it, as I cannot run a windows .exe installer to install erlang?
You can copy erl.exe (plus the runtime system and all the libraries you need) from another installation and run it without the need to install. As long as you are allowed to execute files it should be okay.
Forgive me for not being as smart as Zubair,
but I would like to know exactly how to do this.
I do not have admin privilege, cannot run installers, and cannot copy files to C:\WINDOWS.
In particular, I cannot write to C:\WINDOWS\WinSxS or C:\WINDOWS\system32.
How do I get a list of exactly what libraries are required by the various erlang executables ?
I have all the MS redistributable libraries and manifests,
but I don't know where to put them to make it work.
The redistributable library structure has directories such as
Microsoft.VC90.ATL, Microsoft.VC90.CRT, etc. Each directory contains relevant dlls and a manifest.
Do I copy all the contents into the ERL_HOME\bin directory or ERL_HOME\erts-x.y.z\bin or ERL_HOME\erts-x.y.z\lib ?
or leave them in some other directory and put those entries in the PATH ?
or do I need to build the paths implied by the manifests (i.e. where they would be copied into the WinSxS cache) using hashes and version numbers in the paths, then put those entries in the PATH ?

Resources