Trigger a script at the end of .Appx package installation [UWP] - windows

I have a .Appx package made out of a setup I made using NSIS. I want to know if there is a way I can trigger installation of shortcuts of executable(s) of my package at developer-defined places. We can do it in an NSIS package by writing a .nsi script. Is there something similar for .Appx packages?

We can't interfere with the UWP app installation process, but you can modify the app to request the user to be fixed in the start menu when the app first starts.
If you want to know this, please read this document.
Best regards.

Related

How to change install location of msix bundle?

I have a WPF app that I am planning on deploying with the Windows Application Packaging Project in Visual Studio that makes the MSIX bundle for installations and future updates. The installer automatically installs the app in C:\Program Files\WindowsApps. This is fine until the program needs to cache some data or it needs to modify the appsettings file since the app does not have permission to get to these resources.
Is there a setting I can change in the packaging properties/manifest so it can install somewhere else so I can avoid these problems?
Indeed, only the Windows can write in %ProgramFiles%\WindowsApps when installing the msix package (by design). If your app is writing log files or other data inside the installation folder it will crash.
You need to either update your code to write to %AppData% or, if you don’t have access to the code, use the Package Support Framework to fix it. You can read more about here:
Package Support Framework (aka PSF)
The PSF brings support for API redirection and hooking. Thus, you can fix an app that failed to write a file in the installation folder (this is no longer allowed) and redirects it to a recommended location, or maybe simply update the app’s working directory.
As mentioned above, you cannot write in the install location of an MSIX package - this is by design.
For apps that are no longer under active developer indeed using the Packafe Support Framework is the only way to fix them. However, from what I see you are preparing to launch the app, so you have access to its code.
In this scenario, it is recommended you save all your app settings in the AppData\Roaming folder. For apps deployed as MSIX Windows will automatically redirect it under the Packages folder, but that is handled automatically by the OS, so you don't need to worry about it. More details below.
How to save data under AppData\Roaming instead of AppData\Local\Packages

How to make a .pkg out of a .exe

There is a windows Forms application of which i have made a setup in NSIS. Can i convert this setup built in NSIS into a .pkg for users to install the same on a Mac?. IF NOT, then....
Alternately, is there a way to bundle my application files(comprising of 1 exe, few dll's and some other resource files) and make a .pkg so that i can let users install it on a Mac.
I have read "http://www.mono-project.com/MonoMacPackager#Creating_an_Installer_package" but as i a novice, i need to know whether the above(queries 1 or 2) are possible and if so, please give me a step by step procedure to go about creating a package.
I as a novice, am in Dire need of help on this.
Thanks,
Bomzinho
as mentioned before, you can create an installer for os x with packagebuild. There is no automatic way, developed by anyone and known to be currently publicly available, to convert an nsis script (or executable). You are always welcome to contribute to community.

post installation code in ClickOnce

Is there any way to place code (C#) that will be executed after ClickOnce installation, without running the application?
I saw Microsoft's 'custom installer', which is a nice way to say "why don't you create an installer application", which I prefer not to (I want my users to have a single - well, double - click and that's that).
Any ideas will be appreciated.
ClickOnce applications run when installed - so you could essentially just bootstrap your own application.
You could either put some code at the start of the main entry point. Or, my preferred approach, you could create a second wrapper application. You would make the wrapper be the app installed by clickonce and install the real exe along side it. In the wrapper write your custom code and then when you're done launch and real exe using the Process class.

Mac installer that runs a script

I need to create an installer for a Mac application that not only unpacks the information but executes an script before unpacking the information. Also I want an interactive application that asks for some parameters during installation.
Do you know any tool to do that staff?
Thanks!
/Developer/Applications/Utilities/PackageMaker.app
will let you make .pkg installer bundles, these can include pre and post scripts along with files.
If you can't ask for the information you need during the install, consider moving it to the application when it does a first run.

VS Setup Project: Uninstall other component on install

I am creating a Visual Studio Setup project. I want to un-install another component from the system from the install of my component. The other component is installed from my own setup created using Visual Studio.
Currently when I am calling the un-install of the other component from the install action of the component I get the error code: 1618 (another MSI already running).
Could anyone suggest me an alternative way to solve this problem?
If you don't need to actually run the uninstall of the other component, you could use a Custom Action to remove files/folders you intend to replace.
Using a Custom Action will force you to do all the clean up actions the Uninstaller would do for you.
Is it that you're replacing something or are you just trying to uninstall something as a result of installing something entirely different?
MSDN Custom Action Walkthrough
I have also read a few articles from Phil Wilson that have been helpful with Custom Actions:
Phil Wilson on Custom Actions
I ran into a similar problem that required several installs to run together and could find no way to run MsiExec recursively. The solution I used was to bundle the installer with a script that would run MsiExec once to install/uninstall the old package, then again to run the new installer. Clients had to run the script to install.
If you find a better way, let me know.
I think you can run uninst.exe of that program through the shell command while setup starts.....

Resources