0

I want to run an application on Windows 7, and have it be visible from a salt-master.

My master and minion both have Boron 2016.3.1 on them.

For example, if I wanted to use file.managed to move a test.txt file to my desktop on my windows 7 minion, and I wanted to open it on the visible desktop, is there a way to do that.

Initially I assumed that just running the process via cmd.run would work, but that hasn't worked. And here's a feature request for this.

I thought that maybe, if I installed git bash, and has a bash script that ran notepad it would work, but when I try using a state similar to below:

init.sls

startnotepad:
  cmd.run:
    - name: script.sh
    - cwd: c:\users\myuser\desktop

It doesn't work either. It doesn't run the script at all, and just hangs.

However, when I just run the script from the local machine, it works fine. The script is simply.

c:\users\myuser\desktop\script.sh

notepad test.txt

I'm not sure if this is even possible, but any help is appreciated.


EDIT 1

This question isn't specifically about how to do this with a script. I'm interested in any way it's possible through salt. After asking some questions on their IRC, I've gotten information on it maybe being possible through the salt.modules.win_service.config. The svc_type specifically, but I have no idea how to use this, and everything I've tried has failed.


EDIT2

I found this email chain, where it looks like someone was able to implement this. They said they "tried Allow interaction with the desktop option", but I have no idea how to implement that.

trueCamelType
  • 2,198
  • 5
  • 39
  • 76
  • Correct me if I am wrong. Unless you install ubuntu for windows (beta function in winodws 10), Win7 doesn't recognise file with `.sh` . The script can only be `.cmd` ,`.bat` or `.ps?`(powershell). The other options is Cygwin, but all your program must be specify `PATH` correctly otherwise it can't find your program. http://stackoverflow.com/questions/26522789/how-to-run-sh-on-windows-command-prompt – mootmoot Jul 11 '16 at 07:33
  • I believe when I installed git bash, it added bash to the PATH. I do know that right now if I double click on the .sh script, it runs correctly, and if I open a windows terminal, and run the .sh script it also works. – trueCamelType Jul 11 '16 at 14:39

0 Answers0