donglu9978 2019-05-24 13:44
浏览 57

Golang MSI在Windows上看不到已安装的驱动器

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 西门子S7-Graph,S7-300,梯形图
    • ¥50 用易语言http 访问不了网页
    • ¥50 safari浏览器fetch提交数据后数据丢失问题
    • ¥15 matlab不知道怎么改,求解答!!
    • ¥15 永磁直线电机的电流环pi调不出来
    • ¥15 用stata实现聚类的代码
    • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
    • ¥20 docker里部署springboot项目,访问不到扬声器
    • ¥15 netty整合springboot之后自动重连失效
    • ¥15 悬赏!微信开发者工具报错,求帮改