Using one click install after first install in electron-builder - electron

Is there a way that the same electron-builder installer can first check if the app is already installed. If it is, use the one click install option, otherwise use the complete installer?
In electron builder we have the option to build a one click installer or a more standard installer. Currently, we always use the standard installer as we prefer allowing user to decide where to install our app and whether to install for all users or not. Once this is done, for updates, we like the option for the user to "reinstall" the latest software. For this purpose the one click install option makes more sense.
Note: I couldn't find this question asked anywhere but seems like a common question to me. If duplicate, please post link here and I will remove question.

The standard installer lets the user decide to install the app on a per machine or per user basis, while the one click installer will only install the software on a per machine basis.
So you have a potential problem:
If the initial install is done on a per machine basis, the one click installer will work without a problem. However, if the initial install is done on a per user basis, the subsequent quick installer will try to install itself across the machine, which will result in an install error.
So you should either only ship one type of installer, or both.

Related

VS2019 Setup project for windows service doesn't add the service to the services list

I've built a Windows Service in vs2019 using C# but in order to test it I need to install it. I have built a VS Setup project and I can see this is installing the files into a sub-directory of Program Files (x86), but it isn't adding it to the services list.
I'm new to creating Setup projects, but I do have an existing project built by someone else which I have been using as a guide. As far as I can see I have everything set up correctly, so there must be something not obvious that I'm missing.
I've tried googling the issue but, as usual, there are millions of results but none of them apply to my situation. I'm really hoping someone can point me in the right direction as my experience on Stack Overflow has been disappointing so far.
So, yet again I have to answer my own question. It seems that as well as creating a Setup project I also needed to add an installer to my service. I did this by:
Double click the .cs for the service
Right click on the grey panel that appears and select Add Installer
Select each of the two items that appear in the grey panel and set their properties to appropriate values (Description, DisplayName, ServiceName, StartType, Account etc).
I think ideally this should be done before the setup project is created as it took me several attempts to get the service to install correctly this way around.

Is it impossible to make an electron app MSI installer that is perMachine and not perUser?

I need to make an MSI from an electron app to bundle with another MSI that is also set to per machine and not per user. It appears this combination of things does not exist.
Electron-Builder squirrelWindows: Allows for MSI creation with squirrelWindows and setting msi boolean to true, but there is no perMachine option.
https://www.electron.build/configuration/squirrel-windows
Electron-Builder NSIS: Has the perMachine option but not for MSIs obviously.
https://www.electron.build/configuration/nsis
Electron-Wix-MSI: Creates MSI, but do not see ability to change the perMachine flag.
https://github.com/felixrieseberg/electron-wix-msi
Windows-installer: Creates MSI, no option for perMachine
https://github.com/electron/windows-installer
EDIT - SOLUTION
These pull request changes on electron-wix-msi fixed my problem:
https://github.com/felixrieseberg/electron-wix-msi/pull/138
I've packaged multiple Electron apps per-machine. It's just a bunch of files. Potentially a whole bunch of files. For the ones with an unpacked node_modules directory I just use heat in a prebuild step to author the components. Other then that it's just like any other app.
I made a pull request/branch on electron-wix-msi tailored to fix my problems: https://github.com/felixrieseberg/electron-wix-msi/pull/138

How to silently auto-update an electron application that is installed via NSIS for all users / per-machine?

Project:
We have created an electron application that is shipped to our users (mostly using Windows) using an NSIS installer built with electron-builder.
Scenario:
Our users are companies who install our application into the "C:\Program Files" folder on a Windows Terminal Server for all of their staff. The staff - who is using our software and sees the related update notification after a new release - most of the times can not install the update because of a lack of necessary permissions.
Question:
We would like to not only solve the above problem but even go one step further: We would like our app to update itself silently. What possible solutions are there to make this possible in a scenario like the above?
If you do per-user installs instead then normal users will of course be able to write to the directory.
Another option is to switch to MSI. A signed MSI package can be patched by normal users without UAC elevation. This is called User Account Control (UAC) Patching.
A third option is to create a NT service that runs the installer. Services can be configured so that normal users can start them. A scheduled task might also work.

Deploying Custom Units and Components

When it has come to redoing or reinstalling Delphi, I've run into a hassle. When it comes to components and units I've produced to use in projects, I run into having to go through the entire backup of my projects to find all the things I've used in other projects and copy the units over, install the components through the Delphi interface, and make sure everything is present. Then, I usually forget something and then when I pull out a project that uses one of these units or components, I have to stop whatever I'm doing, find the backup disk, find the data do the install, before I continue...
Main question: Has anyone come up with anything to solve this scenario by automating all of this? Otherwise, what do most people here do when it comes to administration of Delphi in this way?
Some tips:
when possible, avoid installation of components and create instances at run time. This will reduce the time to install them in the IDE. For example, all non-visual components do not have to be installed for design mode.
use a build tool like Apache Ant to compile projects with a build script. The build script then also serves as documentation of environment and source path requirements. When I run the build on a new computer, I only need to check the Ant build script configuration file to see which dependencies exist.
Everytime I produce my own components I consider them as a product I would sell. In this sense, what I do is to build a setup wizard that installs the components in Delphi IDE in the very same way it would for a customer.
Anytime I have to reinstall my computer or Delphi, I just have to run my setup wizards and all the work environment gets ready.
I use InnoSetup (http://www.jrsoftware.org/isinfo.php) to build my setup wizards.
I set up Environment Variables
Delphi menu \Tools\Options\Environment Variables
New User Overrides, Example: Variable Name: OutsideComponents; Variable Value: C:\mycompdir\mycomp
Lots of options in how to use the EV's
You can Set them up to use for all your projects...
Delphi Menu \Tools\Options\Delphi Options\Library path Example: $(OutsideComponents)\
Or just link use them in the project..
Delphi Menu \Project\Options\Directories/Conditionals\Search Path Example: $(OusideComponents)\Comp1

Using subversion across visual studio and Xcode [duplicate]

It seems that all of the initial Google results for "using subversion with xcode" are actually just tutorials for installing and configuring svn and Xcode, as opposed to actually using the two (i.e. interacting with svn via Xcode's GUI).
Is anyone aware of a good guide that teaches the tricks and pitfalls of working with svn via Xcode's GUI? Something that bridges the gap between the most excellent Version Control with Subversion book and the Xcode IDE (as in pure Xcode GUI without any terminal command use)?
Edit:
We all love our terminal commands, and we all love Eclipse but (and I mean this in the nicest possible way) neither is really the point of the question. I’d prefer to use svn via Xcode’s IDE instead of via terminal just as I prefer (well, for this case) to code in Xcode’s IDE instead of using vim and gcc. Apple engineers spent a good bit of time implementing that SCM menu in Xcode; someone has to have seen a usage guide somewhere.
I used this page as a reference for setting up my XCode projects with SVN. It is a good starting point, but I'll give a short walkthrough of what I did (since the page isn't really all that helpful!).
A couple notes: I'm using XCode 3.1.2 and Subversion 1.4.2. I've heard of problems with using SVN 1.5, but there are ways around that which I wont get into.
First off, I had a repository already set up and created the XCode project afterwards.
In XCode you need to set it up to know about your repository using the SCM tab in the preferences window. Enter:
A Name (this is arbitrary and used for reference with XCode)
The scheme (http or svn)
The host (i.e. svn.example.com)
The path (the exact path to the SVN repository located on the host)
The port (only if it isn't the default)
And a username and password used to access the repository.
The URL will be auto-filled as you enter the other fields. Hit "OK" when all the fields are good and XCode says it can connect.
Then open your project and do a "Get Info" (Round blue icon with an exclamation mark) on the project itself. Under the "General" tab down at the bottom is an option for SCM, select the repository you made in 1 and close the window.
Now open SCM in the menu-bar and go to "Repositories." Hopefully you've built your repository right using branches, trunk, and other directories at the base level because XCode doesn't have support for checking out the root directory. So go one directory at a time down the list and click the "Checkout" button and select a directory to check it out to (I recommend a "Code" or "Source" or "SVN" directory inside your XCode project directory). You cannot checkout multiple directories at once, but you can tell the next directory to checkout before the first has finished and XCode with queue the commands.
Once that is all done go back to your XCode project window and "Add -> Existing Files..." to your project. Select the directory you've checked out the repository to and I recommend using the "Create folder references" option instead of the "Recursively create groups" option because added and removed items will be automatically reflected in a Folder Reference but not in a Group.
Now you've imported your SVN repository into an XCode project. From here any time you make a change, simply Right-Click (Control-Click if you only have 1 button) in the file and at the bottom of the context menu are the SCM options for comparing, committing, updating, and discarding (reverting) the file. You can also use the SCM menu in the menubar for file or project-wide updates/commits/reverts.
I second the comment by the_mandrill, SVN support from within XCode is very limited, especially if you're used to Eclipse.
I also don't understand why everyone seems to need visual clients. I keep a terminal window open on my project directory and I have no problems interacting with SVN from the command line.
I know this is not quite what you asked, but I wouldn't rely much on the use of SVN from Xcode as what you can do with it is very limited. It's useful for being able to do a diff or annotate direct from the IDE but not a great deal else. I don't think it's any substitute for using a separate standalone client such as SmartSVN or Versions.
You also have to jump through a number of hoops to get Xcode to work with SVN version 1.5 onwards, so that's something to be aware of before installing a standalone client. If in doubt, check out a sandbox first.
Here is one of the best tutorials to configure subversion in XCode - http://iphonedevelopment.blogspot.com/2009/03/version-control-is-your-friend.html
It also teaches even to create repository in local MAC.
if you want to work with svn through a gui interface then i suggest you use eclipse + subclipse plugin (which have more features and much more reliable and easy than svn on xcode)..
you will work in xcode as normal but you will use eclipse only as an svn client (by creating a general project in eclipse and make it points to your xcode project directory )
and here is a tutorial of how to install subclipse
A lot of people have problems using the build in svn client, especially to get a new project into svn and that it works.
I created a straight foreward tutorial on how to do this, along with a very well known pitfall (works for Xcode up till the latest version of xcode incl. Iphone 4 sdk)
http://www.sodeso.nl/?p=599
I myself looked up for some good resources and one of the best I've found is a quite recent video from the WWDC 2012 :
Sign in here if it's not already the case : https://developer.apple.com/videos/wwdc/2012/
Then there is a video called :Session 411 - Source Control Management in Xcode
It explains how to use version control both with GIT and Subversion. It's really nice !
Hope it helps!
As has been mentioned in many other answers, the svn client with Xcode is quite weak (and that is being kind).
Personally, I think that running Eclipse just to get access to a svn client is a bit heavy handed.
I would suggest two answers:
Use a dedicated svn client for the Mac (Versions and Cornerstone are both very good, albeit not free... there are free ones, such as svnX)
If you are not wildly comfortable with the terminal, you can script a couple of the key commands that you want to use and add them to your Xcode user scripts folder, then you can trigger them from a menu item of from a keystroke, just as if you were using the Xcode native client. There's a ton of examples on how to do this available via Google.
I came across these - no idea how well they work, but wanted to add some resources if I could:
http://www.macresearch.org/tutorial-introducing-xcode-30-organizer
http://developer.apple.com/tools/subversionxcode.html
With XCode4 you can perform almost all of your SCM tasks from within the IDE itself, this is a great step forward.
Here is a link to the official guide :
http://developer.apple.com/library/mac/#documentation/ToolsLanguages/Conceptual/Xcode4UserGuide/SCM/SCM.html#//apple_ref/doc/uid/TP40010215-CH7-SW26
Unfortunately you still have to use the Terminal command line to add a new project to SCM, this is also clearly documented in the link above.
What it does not tell you is that you also need to manually add ignore instructions to your SCM configuration otherwise you are going to end up with user settings and build outputs in your repositories. I am currently figuring out the list and I will update this answer once I have it finalised.
PS :
I know this question is quite old now but I have added this for those of you who arrive here looking for answers like I did.
PPS :
Terminal command line increases probability of human error, takes longer, is more complex and is less transparent to end users. Overall the omission of being able to add projects to SCM from within XCode is poor design, I expected better from Apple who are usually good at simplifying UI. For the command line fans out there you might feel L337 but try managing a team of programmers and being responsible for their code, command line is not your friend.

Resources