Open tmrobert8 opened 6 years ago
License of Inno Setup looks fine, it's BSD-style, so should be no problem.
I don't know how exactly the sources for such an installer will look like, but considering that we have dedicated repos for docker, synology, linuxpkg, etc., I would say that this should go into a dedicated repo as well. Feel free to start with one on your own Github and once it is ready, we can transfer that repo over to openHAB.
@kaikreuzer I've started to think about this more and wanted your input...
Here's the features I was thinking:
1, 3, 4, 6 are pretty easy and straightforward.
2 - I think it would be easy to pick up on the latest stable from bintray without knowing the version number. However, the second part (choosing snapshot/version) would be more difficult - is there anything online (github or otherwise) that lists the OH versions available? My goal of the install is to make it version independent so we don't need to update it with each version. I could ask them to input the version they want - but not really user friendly if I can present a drop down listing the version - but then I'd need to have a source of versions. Thoughts?
5 - I really want to do this as most people would run it as a service. However, the current way (karaf wrapper + special conf) is really a stopping point because I'd have to open up a session (wait for all the initialization task to complete), install the wrapper (feature:install followed by wrapper:install) then [from somewhere] download the special conf and install it, then create the service - really complicated for an install script to do. Do you know of any alternatives to this?
I could quickly put together a service class (small C# service) what simply calls the 'start.bat' on startup, monitors the process and would call 'stop.bat' when ending. Pretty quick and doesn't require any special conf - but introduces a different type of service (ie not karaf) and I'm not sure you want to go there..
Tim
is there anything online (github or otherwise) that lists the OH versions available?
Maybe you can use: https://ci.openhab.org/job/openHAB-Distribution/ ? (this is for snapshots 2.4.0 S) https://ci.openhab.org/ has also the milestone releases (2.4.0 M) listed as well but not the stable release (2.3.0
They offer RSS and REST API (maybe you could use them to pull this info from their website?)
I don't know if there is a better online resource that covers all options (Stable, Milestone, Snapshot)
I really want to do this as most people would run it as a service. [...] Do you know of any alternatives to this?
I think that if we fix https://github.com/openhab/openhab-distro/issues/467 then it will become easier to deploy as a service. I will look into this to see if we can progress this old issue.
@AngelosF Thanks - for the initial go around, I'll probably just have a single file that needs updating for the various versions.
The real issue with the service is not being able to easily create it (the conf file is the least problem actually). What I'd need to do is open up a telnet session, wait for initialization to finish, issue the feature install for the wrapper, issue the feature install to create the service then close all that. Too much for an installation service. What would be handy if there was a single command line that I could issue that would do that for me (then I simply have to issue the command and wait for it to finish).
An alternative would be to simply embed (in the installer) the wrapper stuff to begin with (the exe, dll, conf, etc) and copy it over when needed. The only issue with that would be the snapshots (if something changed from snapshot to snapshot with the service creation).
At any rate, unless someone has some simple approach that would work - I may ignore service creation on the initial version..
I think that you should ignore the service installation for the initial version
It is an optional component of Karaf and it is difficult to deploy.
We already have documented installation steps that could be used to install the service after you deploy OH2 on Windows using your installer.
By the way, the Karaf docs refer to another tool that could also be used: https://github.com/kohsuke/winsw Ref: http://karaf.apache.org/manual/latest/#_service_script_templates Section: Windows
Do you think this is winsw tool can be used ? (for the next release)
The documented steps is great for someone who knows what they are doing - but I'd wager that most windows users are non-technical and those instructions would be too intimidating to complete.
winsw is one of the MANY service wrappers we could go (or I could write one myself - about 30 lines of code) with if it would be okay to abandon the karaf one. I was worried whether it would be an issue to ignore the karaf wrapper in favor of something like that. Note: if we want to go with winsw, I can add that to the initial version since it's pretty easy to setup..
I believe we need @kaikreuzer 's opinion here (if the installer should include the service installation method also for the first release or not).
Also: I believe that Kai is the best to best answer your other question: "is there anything online (github or otherwise) that lists the OH versions available?"
Technical solution for the service wrapper: I think you are the best to decide on that 🥇
On an "importance" scale from 0 to 10, having openHAB running as a service on Windows gets a 8 mark from me :)
If people use Win for "production" they will definitely want to run it as a service. For testing and playing: it doesn't hurt to have the Karaf console running.
I was worried whether it would be an issue to ignore the karaf wrapper in favor of something like that.
Not for me - the Karaf wrapper does not seem to work well on most platforms, so I'm fine with ignoring it and providing a better solution instead :-)
is there anything online (github or otherwise) that lists the OH versions available?
I actually do not know. But we already have to maintain those links for https://www.openhab.org/download/, so @ghys might be the right person to answer, how/where we can maintain the urls to the latest version (btw, @ghys, the milestones are still missing on the website and should probably be added there as well).
@kaikreuzer Thanks - I'll see about using winsw as the wrapper then. BTW - I switched from Inno Setup to NSIS as there were some issues using inno setup for what I wanted. Applicable license: https://nsis.sourceforge.io/License - I don't think there are any issues here but let me know if you have some doubts.
As for the versions - for the initial version, I'm just using a file to let me know the versions (simple version=desc). Example:
2.3.0=openHAB 2.3.0 Stable
2.4.0-SNAPSHOT=openHAB 2.4.0 Snapshot
I then use the same logic as the update scripts to decide on what links to hit to get the downloads. So for now - a simple update to the file would be necessary to add a new version.
A really nice to have would be some json file hosted somewhere that would be something like:
[
{
"version": "2.3.0",
"desc":"openHAB 2.3.0 Stable",
"url":"https://bintray.com/....",
any other useful info describing the version
},
{
"version": "2.4.0-SNAPSHOT",
"desc":"openHAB 2.3.0 Stable",
"url":"https://ci.openhab.org/..."
}
]
I don't think there are any issues here but let me know if you have some doubts.
lgtm, I don't see issues with that either.
I actually do not know. But we already have to maintain those links for https://www.openhab.org/download/, so @ghys might be the right person to answer, how/where we can maintain the urls to the latest version
Currently it's only in the frontmatter of the download page (https://github.com/openhab/website/tree/master/download > currentVersion
/currentSnapshotVersion
).
IMHO at least for the website following the KISS principle is the right way to go - but I wouldn't object to having some API call or similar during the build to retrieve current values.
(btw, @ghys, the milestones are still missing on the website and should probably be added there as well).
Right, I'll get them on the page as well!
Quick update - I've created an installer and have tested it pretty well now.
ToDo:
Issues left:
@ghys @kaikreuzer Kinda getting off topic on this issue - but since we are discussing issues. If we could get a simple file (json, xml, or properties) that describes the versions, the descriptions and maybe the type (milestone, snapshot, stable) - then there are three things that can use it:
For now, in the windows installer - I have a simple text file that controls the version shown
Attached is the first try at the installer. Note: there may still be issues but it covers the ground pretty well. Hoping @bdleedy or other windows users will shake it down - once it seems stable, I'll invite some people from the community to try it.
How to Download, unzip and run it.
Notes:
2.0.0 and 2.1.0 Notes
2.2.0 and 2.3.0 Notes
2.4.0+ Notes
Is this meant to be an updater as well? I would say yes, right? I tried 2.3 to 2.4. I still have 2.3....ish. It's definitely trying to run/install 2.4 things but not being successful at it at all. I think this needs some clarification first before I get to crazy with comments.
The existing service was never deleted, that would be nice. I think it was looking for one specifically called the same thing as what it did install then. This leads me to believe that you built it as an updater as well.
2018-12-20 18:10:37,705 INFO - Uninstalling the service with id 'openHAB-2.4.0'
2018-12-20 18:10:37,721 WARN - The service with id 'openHAB-2.4.0' does not exist. Nothing to uninstall
2018-12-20 18:10:37,721 DEBUG - Completed. Exit code is 0
2018-12-20 18:10:37,971 DEBUG - Starting ServiceWrapper in the CLI mode
2018-12-20 18:10:38,236 INFO - Installing the service with id 'openHAB-2.4.0'
2018-12-20 18:10:38,268 DEBUG - Completed. Exit code is 0
It doesn't have any detection to find a current instance? I don't know if that's something we want to get into or not. Maybe a rewording on the install location dialog?
It would be nice to have everything for each schedule creation on one dialog but I can understand that being tough. Maybe some sort of wording to make it known that more config will be on the next page?
A bit of clean up for this checkbox.
Uninstall works pretty well.
Does it write a log file itself?
Just did a bunch of work on this and have a fairly good version with everything I wanted in it. @bdleedy could you give it a quick try and give me any feedback (it's fairly complicated now and I'm sure there are still issues - that's why it's a beta). You can find the download link in the release section of my new repository (including README to describe everything). Look at https://github.com/tmrobert8/openhab-windows-utils
@kaikreuzer I named it openhab-windows-utils for two reasons:
If things look ok - I'll invite people from the community to try it
Just pinging @bdleedy to see if he's had time to look at it? I know alot has been going on but I don't want this dropped..
I installed 2.5 snapshots through your installation program, it worked the first time ..... Congratulations You should make it productive Question:
@Gozilla01 Look in the runtime/bin directory - you'll see a bunch of batch files. There is an update.bat (can't remember if you need to run it as admin or not) that will do both of those (and can even downgrade if you want).
I tried the file is it works. Thank you
@kaikreuzer Quite a few people have used this now successfully - want to move it over to the openhab repositories?
Sounds good, @tmrobert8, I think we could move it to become an official openHAB util. Just one question as this isn't fully clear to me yet: Do we need to build a new installer with every openHAB release (incl. milestones)? Or can the installer pick up any most recent openHAB builds? If we need to rebuild the installer, we will have to think about a way to automate this. And I assume, it can only be done on a Windows machine, right? How could we handle that?
@kaikreuzer
If you look at the top of this discussion, I asked if there was a way to get all the openHAB versions (json file, something) and it appears there is not a way to do it.
Because of that - there is one file that will need to be updated each time and the installer rebuilt (which can only be done on windows and I haven't the slightest idea how to handle that).
An alternative however is that if we make this an official openhab repository. I could modify the installer to pick up the version file from the repository itself - then we'd only have to commit changes to the file and the installer would work just fine - probably would be the best approach
@kaikreuzer How to we proceed on this?
@kaikreuzer Did a bit of work on this and it's VERY easy now to have it automatically built using Azure Pipelines (for open source projects - you have unlimited minutes and was very easy to setup. Take a look at:
Turns out it was unbelievably easy to use (we've started using devops at work and it's a really, really nice build system).
If you want to move forward with something like this we need to:
At that point - it will be setup to run whenever there is a commit. I probably create two pipelines - a build pipeline to simply ensure the build works and then a release pipeline to actually create the release. Neither would be difficult to do.
If you want me to help out - let me know..
Sure would be nice to have around...especially if it handles upgrades.
Is this project dead? Last comment from the developer is over a year ago.
Is this something that is going to roll out with V3?
As above. I've installed Openhab 3 and requested an update function within the UI. Not sure if this is possible though.
Is this project dead? Last comment from the developer is over a year ago. Is this something that is going to roll out with V3?
This is probably my fault as I failed to follow up 😢 .
@tmrobert8 My apologies. Would you still be interested to finish this work? I could try to arrange you access to Azure on behalf of the foundation for setting up the build parts of it.
What is the status of this? You can also create a GitHub Actions build using Windows nowadays.
Not sure if this is something that should be in distro - so please let me know if there's a better place for this. I'd like to create an actual windows installer for openhab that has the following features:
In the past, I've used Inno Setup (you can read the license here: http://www.jrsoftware.org/files/is/license.txt) and it works well but would be open to other suggestions if anyone has strong feelings (wix or nullsoft)