Skip to content

Created msi installer for windows #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Created msi installer for windows #27

merged 2 commits into from
Apr 1, 2024

Conversation

devkimittal
Copy link
Collaborator

No description provided.

@CLAassistant
Copy link

CLAassistant commented Mar 28, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ devkimittal
❌ abhay084
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -142,4 +143,16 @@ func initLogging(c *config.Config) {
if c.Trace {
l.SetLevel(logrus.TraceLevel)
}

dir, _ := os.Getwd()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do it only for windows, let's not touch other os

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README.md Outdated
If you want to install harness-docker-runner as a service in windows please follow the bellow instructions.
#### Installation
* Download the msi (harness-docker-runner-svc.msi) from latest releases
* Double click the msi to start the installation process
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we see the permission error, let's put instruction for that

README.md Outdated
* click Uninstall and finish.
#### Additional Instructions
* Service will automatically started even if you re-started your VM
* You can manually Stop/Start the service from service menu tab.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why would the cusotmer need to manually stop or start? Document it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case if they did

README.md Outdated
* open the cmd as administrator and run below command
```
=== start the service ===
sc.exe create harness-docker-runner-svc binPath="Path/to/your/binary server"
Copy link
Collaborator Author

@devkimittal devkimittal Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure harness-docker-runner-svc doesn't exist before we do this.
binPath="absolute_path/to/your/harness-docker-runner.exe server"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sc.exe start harness-docker-runner-svc

README.md Outdated
* Accept the liecence, click next and finish the installation.
#### Uninstallation
* Search and open add or remove programs from search menu
* search for harness-docker-runner-svc
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harness-Docker-Runner

* Download the msi (harness-docker-runner-svc.msi) from latest releases
* Double click the msi to start the installation process (If you see any error while opening the file please follow the instruction from below url)
* https://answers.microsoft.com/en-us/windows/forum/all/this-installation-package-could-not-be/d6d913e9-aac7-429a-ac0d-c39ad3a7c5eb
* Accept the liecence, click next and finish the installation.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verifiy using curl http://localhost:3000/healthz

wix.json Outdated
"hooks": [
{"when": "install", "command": "sc.exe create harness-docker-runner-svc binPath=\"[INSTALLDIR]lite-engine.exe server\" start=auto DisplayName=\"harness-docker-runner-svc\""},
{"when": "install", "command": "sc.exe start harness-docker-runner-svc"},
{"when": "uninstall", "command": "sc.exe query harness-docker-runner-svc"},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using inline command do, {"when": "uninstall", "batch-file": "uninstall.bat"}

README.md Outdated
* open the cmd as administrator and run below command
```
=== start the service ===
sc.exe create Harness-Docker-Runner binPath="Absolute Path/to/your/binary server" start=auto DisplayName="Harness-Docker-Runner"
Copy link
Collaborator Author

@devkimittal devkimittal Mar 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure Harness-Docker-Runner doesn't exist before we do this.
binPath="absolute_path/to/your/harness-docker-runner.exe server"

@devkimittal devkimittal force-pushed the msi branch 2 times, most recently from f85a45f to c6e8308 Compare March 30, 2024 04:59
@devkimittal
Copy link
Collaborator Author

Latest msi created using this code https://tmpfiles.org/4552062/harness-docker-runner-svc.msi

@devkimittal devkimittal changed the title Create MSI installer for windows Created msi installer for windows Mar 30, 2024
handle uninstall case

add instruction for msi service in readme

add instruction

add instruction

add instruction

correction

fixed uninstall
@abhay084 abhay084 requested a review from raghavharness April 1, 2024 06:48
)

func main() {
cli.Command()
if runtime.GOOS == "windows" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just make sure that this works for both msi way and non-msi way

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it works directly with .exe as well. Tested this with Devki

@abhay084 abhay084 requested a review from raghavharness April 1, 2024 11:03
if RunTime.GOOS == "windows" {
dir, _ := os.Getwd()
logFilePath := dir + string(os.PathSeparator) + "harness-docker-runner-" + time.Now().Format("2-January-2006") + ".log"
logrus.Errorln("Logs will be dumped to : " + logFilePath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why error log ?

@abhay084 abhay084 merged commit 8c38321 into master Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants