1

So I have an windows msi installer that I created by cross compiling from a golang program and installed on a client windows machine. The program sends data out from a folder on the windows machine to a Kinesis stream. The program works fine for all files and folders on the local C:\ drive.
My issue is that when the client is using a mounted NTFS drive ("I://, J://, D://") I get an error message with

level=info msg="Ignoring target I:\\xml with invalid stat: open I:\\xml: The system cannot find the path specified."

No matter the mounted drive (E,F,G, etc) I get the same error message. I've tried this across multiple clients and received the same error.

So just for background- I'm compiling the program using wine to get it to an msi when building. The program is taking on a SYSTEM USER role and I've already checked permissions on the mounted directories (and made them wide open- still no luck). Been banging my head against the wall over this one for a while so the question is: has anyone else had an issue like this?

Don't know how much this will help but here is the specific portion of GO code I'm using:

p, err := filepath.Abs(t.Path)
            if err != nil {
                Logger.Infof("Ignoring invalid target path: %s, error: %s", t.Path, err)
                continue
            }
            _, err = os.Lstat(t.Path)
            if err != nil {
                Logger.Infof("Ignoring target %s with invalid stat: %s", t.Path, err)
                continue
            }
            c.targets = append(c.targets, site.WatchTarget{p, t.SrcTag})

I've tried os.Stat, Lstat and even os.Open to no avail. Just about at the end of my tether on this one.

The ideal result would be a suggestion on any changes you could suggest that would allow a system user from a cross compiled go program to see mounted network drives.

Fern
  • 41
  • 4
  • How are you compiling to MSI? That's not supported natively by the Go toolchain. – Adrian May 24 '19 at 13:47
  • This might not be Go related, as when I tried MSI installers in the past on attached drives (created using `subst`), I always got similar errors ("path not found"). I always had to switch to the original folder that was attached as a new drive for MSI to work. – icza May 24 '19 at 13:48
  • Creating the msi using wix and wine. @icza- can you specify "switch to the original folder that was attached as a new drive for the msi to work"- do you mean literally dump the msi there or change directories into that? Thanks so much for the help everyone! – Fern May 24 '19 at 14:03
  • So is it actually compiling Go code to MSI, or are you just using it to make an installer for a Go application? If it's the latter, the Go code (or the fact that it's Go at all) is irrelevant, it's the MSI and its scripts that are the issue. – Adrian May 24 '19 at 14:04
  • Fair point. It's building to WINDOWS, (GOOS=windows, GOARCH=386) and then being run through wix. Sounds like this might be a good place to start as I can stop looking at the code and look for better ways to build the msi... – Fern May 24 '19 at 14:37
  • Does the app work when you set it up manually? I don't really see how the MSI itself is to blame here? – Stein Åsmul May 24 '19 at 22:17
  • As I said, not sure I understand the actual problem properly, but [here is a link with information on what credentials different system accounts present to the network](https://stackoverflow.com/a/510225/129130) (among lots of other details). – Stein Åsmul May 25 '19 at 00:14

0 Answers0