Wix Installer - Custom prompt, using what’s entered during install - wix

I am new to using Wix, but I have been able to install my windows service fine what has no UI prompts currently, but I have now been asked to allow custom installations. What I mean by this is they want us to prompt the customer for a text entry like company name, and then we use this in the install directory e.g. C:\Program Files (x86)\MyApplication\Company Name and also for the Windows service to have this e.g. MyApplicationWindowsService – Company Name.

It's vary big and general question. I suggest you to start with some tutorials on how to customize the UI.
For Example: Tutorial 1, Tutorial 2.
After trying to implement your customize UI with no luck, you can post a new question with specific details and your snippet code.

Related

Adding software setup to installer

I'm writing an installer for an application. Most of the installer is done and working, but I have on more step outstanding. I need some way to add a setup window to the installer, that will take user input like server address and port, etc. and write these to the relevant files for system start-up. This preferably done through a GUI of sorts inside the installer.
I've tried creating an executable file that runs after installation, but this does not always execute on different systems.
Is there a way to add a GUI to the installer itself that executes after the directory structures and files have been put into place?
Thanks in advance.
In general you should seriously consider doing this as a standalone app that runs when the app first runs and needs configuring. Then it's a program that runs in a user context and can be tested and debugged in the normal way. At least consider what the user is going to do if they want to change the server address or the port - will they need to uninstall your app and reinstall it just to change the server details or the port?
The GUI may not run correctly when started from the install for a number of reasons. It may be initiated with the system account if it's a deferred CA. It wasn't started from the interactive user shell, so it probably won't have any idea of a working directory. It's being run from an msiexec.exe process running in the system directory and maybe with a system account - that's not really the place to be doing your GUI configuration.
I assume you're using WiX, it doesn't say so in your question but it's tagged with WiX.
I would have a read of http://wix.tramontana.co.hu/tutorial/user-interface-revisited (or http://www.dizzymonkeydesign.com/blog/misc/adding-and-customizing-dlgs-in-wix-3/ has a relatively easy to read example), you can add or edit any of the dialogue boxes in the installer, you'll need to download the source to get at the built in dialog, and it does require some "play" to get everything quite right but worth it to get a professional looking installer.

Silent Installer For Windows built via Inno Setup [duplicate]

This question already has an answer here:
How to make the silent installation by using Inno Setup?
(1 answer)
Closed 8 years ago.
I have a installer for my program that has been built using INNO Setup. I want to convert this installer to silent installer/unattended installer, such that the user doesn't have to enter anything and the files gets extracted to a predefined location.
I have done my homework and found out that it can be done via command line parameters, but I don't expect my user to go through all the pain.
I just want an exe, which on double click should install my application. Is it possible to enter some parameter in the INNO script to make the installer as silent ? (I didn't find any pointers to this)
Any help is appreciated :)
You should change your requirement.
It doesn't matter whether AVS declare it as suspicious or not, users will in general consider something malware if it performs drive-by-installs without letting them know about it. It is not "hassle" for users to confirm they want to install when they run the installer -- and that is all that Inno requires for a non-silent install.
You can skip every page in Inno except one in a non-silent install. You can decide whether that one is the welcome page (just shows general intro text), the ready page (shows information about where it will be installed), the dir selection page (to let them choose where to install), or even a custom page. Inno doesn't mind which single page you want to show, as long as you show at least one.
The only case where it is acceptable to jump straight to "installing" without any preamble is when the installer is being run from another program at user request (eg. your application found an updated version of itself, asked the user if they wanted to install it, then downloaded and ran the installer). In this case, the parent application should be using the command line to request a silent install.

Creating automated Installer for any Program

How can I create an automated Installer for a program that has a regular Installer with questions like:
Install Directory,
Accepting License,
Creating Icon on Desktop
etc...
Assuming that I am OK with building an Automated Installer for every program I want to separately, Or i want to put files in a Self Extracting Archive and run the Installer after unpacking.
Do I need a third party program for it? Should I use Command Prompt? Do I need to learn Lua? (I'm learning C#)
EDIT:
To clarify I'll use an example:
Let's say i wrote a program but that program has a requirement, like
DirectX, or Adobe Air, or Maxthon Browser.
I wrote my program in such a way that I have to be sure that that is
installed in a very specific Drive/Folder on the PC or with some
specific preferences/parameters.
I include an installer for this program, but I want to specify where
it gets installed on the PC and with what parameters.
Preferably Installing this requirement right after or during the
Installation/Extraction of my own program.
I'm looking for a way to be able to run the Installer of any given program and navigate through the install wizard of it with out the user having to/being able to change the settings I need (with the foreknowledge and permission of the user of course).
It doesn't need to be silent install or anything.
I have rewritten my answer.
Your mentioned setups requirements seem very common to me for the class of installation programs (setups) and not at all unusual.
Generally you have two options:
You write everything on your own, you create the install dialogs, the way the settings are saved, and so on. Then you are fine with C# (or any other language).
It is quite uncommon to do so, because it is time consuming, and you are reinventing things which have been solved in standard ways several times. Moreover you will fall in common setup error traps which are maybe already captured (or at minimum documented) if using tools.
If you want to use a tool, it is your first decision, if you want a tool based on MSI (Windows Installer) or not. MSI is the most powerful and most industrial-accepted setup technology in Windows, but it is a quite complicated matter, and no tool can shield this 100% from you. Google for WiX (Open Source) or InstallShield as starting points for MSI tools but there are of course more.
Some tools are already integrated or integrateable in Visual Studio for example.
Selfextracting tools are a starting point, but the following tools offer far more and are a good intermediate way between the extreme points SFX and MSI:
InnoSetup
(has also a home here on SO).
Nullsoft Scriptable Install System (NSIS) on SourceForge
One self extracting program in Windows I want to mention, because it is not widely known, that "IEXPRESS.exe" is already included in the OS.
Concerning your special question of navigating through the install wizard:
Every mentioned tool has ways to save install settings and of course is deciding which settings are changeable by the user part of the 1*1 of setup creation. With the tools you can design the install dialogs like you want consisting of the parts you want.
I hope I got your point.
P.S. While most tools have kind of a scripting language or something similar included, you are normally free to extend the installation process with your own actions written in nearly every programming language you like.

Create a bootstrap that passes arguments to the msiexec

I need to create a bootstrap for my WiX project I've tried using setupbld.exe but it will only allow me to create an executable that will show my UI or one that will behave as a silent installer but not both.
I need to be able to run the resulting executable with argument that will tell it wether or not to show the UI during installation.
I've found this post by John Robbins that explains how to re-build the setup.exe stub used in the creation of the bootstrap but I was hoping there is a simpler way to do what I need.
Does anyone know of a way to create a bootstrap that I use to run either as a simple (with UI) install or as a silent install.
I've seen dotNetInstaller recommended on the WiX mailing list a lot, should be a lot more flexible than setupbld.exe but I haven't used it myself.
Update: If you've got budget to purchase software, try the bootstrapper that comes with MSI Factory (the demo just displays a nag screen before launching the bootstrapper). We use this ourselves and it's been worth every penny.
AT the end I've used 7zip to zip the MSI in a self extracting archive.
You can add a "config" file to let 7zip which files to run when opening the executable.
Check out 7zip's manual for more details.

Cocoa - How to copy files to /usr/share?

I'm developing an "installation" like cocoa application wich needs to take care of some http request, some file system reading, copying files to /usr/share, set up cron (not launchd) and ask some information to user.
I discarded PackageMaker since I need more flexibility.
Currently everything is going well, but on my last installation step, I need to:
Delete my previously installed application folder (if exists). It's always the same path: /usr/share/MY_APP
Create again the application folder at: /usr/share/MY_APP
Copy application files to /usr/share/MY_APP
Update a cron job
It's very important that /usr/share/MY_APP keeps protected with administrative privileges, so a regular shouldn't delete it.
What would be the best approach to implement those steps?
BTW, I'm using Xcode 3.2.
Thanks a lot!
Carlos.
Between the preflight script, the postflight script, and perhaps an Installer plug-in for the custom UI, I see no reason why you can't do all of this in PackageMaker.
Note: “Installer plug-in” is a little misleading. The user does not have to install the plug-in somewhere as a separate step; you include the plug-in inside your package, and Installer will use it from there.
The relevant document is a ReadMe file in a sample code project. There's also an Installer plug-in project template in Xcode since 2.0.
Also, an Installer plug-in won't get used if the user does a command-line installation. Of course, they can't install from the command line at all (which includes remote installation onto an office or lab full of machines) if you write your own custom installer.
By the way: Why /usr/share? What are you putting there? There may be a better way to do what you're really trying to accomplish.