In which mott555 has problems with %PATH%



  • Status: Apparently unable to alter the global PATH variable in Windows 8. I can alter it for my account, but my changes don't work for the system service account used for the CI system. This :hankey: works fine in Windows 7!



  • How are you altering it?





  • More importantly, why? You shouldn't be mucking about with ancient relics of DOS!



  • Did you restart? I think that's a requirement for the SYSTEM account picking up changes. It used to be, anyway.



  • @Magus said:

    More importantly, why? You shouldn't be mucking about with ancient relics of DOS!

    Our build system requires a bunch of dependent executables to be in PATH so we don't have to hard-code the exe path which varies depending on OS, 32-bit vs 64-bit.

    @loopback0 said:

    Did you restart? I think that's a requirement for the SYSTEM account picking up changes. It used to be, anyway.

    Restarted, logged out and back in, restarted the service, etc. No go.

    I have a hack that works, I'm altering the PATH variable in the build scripts...however this negates the reason it's in PATH to begin with and will probably bite me in the arse someday.



  • Heh...\Binn\


    EDIT: FTR, this started in Status, I wasn't joking around in Coding Help.



  • @mott555 said:

    Our build system requires a bunch of dependent executables to be in PATH so we don't have to hard-code the exe path which varies depending on OS, 32-bit vs 64-bit.

    Clearly you weren't listening in the massive thread about this, but that's definitely the wrong way to do that. There are specific system calls that will definitely work, and won't give you dumb messages or make you be like eclipse.



  • :wtf: I don't think Python has system calls for Doxygen, Inno Setup, devenv, and such.



  • @Magus said:

    Clearly you weren't listening in the massive thread about this, but that's definitely the wrong way to do that. There are specific system calls that will definitely work, and won't give you dumb messages or make you be like eclipse.

    Are those system calls usable from within a Makefile, or some other sort of janky-arse build automation framework?



  • @mott555 said:

    :wtf: I don't think Python has system calls for Doxygen, Inno Setup, devenv, and such.

    TDEMSYR

    @tarunik said:

    Are those system calls usable from within a Makefile, or some other sort of janky-arse build automation framework?

    Then use one that isn't stupid?

    Honestly, an ini would be better than putting things in PATH.



  • @Magus said:

    Then use one that isn't stupid?

    Enlighten me, please.



  • Look, if your build automation can't do things that a powershell script can, and you need those things, you need a different build system.


  • Discourse touched me in a no-no place

    See if this helps? (it's probably better to write a program to do that, maybe that reads from a system-specific ini file or something, than to set the path in your batch file.)



  • Great non-answer.



  • I suspected the registry was the way to go, but couldn't find the system-wide Environment.


  • sockdevs

    @mott555 said:

    devenv

    Why is your build system calling devenv? Surely it should be delegating to MSBuild, or going to the MS compiler toolchain directly?



  • :wtf: That registry key shows my modified PATH with the added settings....and it doesn't match what gets printed out by the Jenkins CI task if I have it dump the PATH to console... :wtf:



  • MSBuild didn't exist until VS2010...we still do VS2005 and VS2008 and need a way to support them as well.

    Also, I'm working on old build scripts that predate my working here, and have never dealt with automated builds before. I'm sure there are WTFs all around but I don't know enough to spot them.



  • @mott555 said:

    Restarted, logged out and back in, restarted the service, etc. No go.

    That's strange :wtf:.

    do have some scripts on both Windows and UNIX that add things to PATH at the start. Because sometimes it's easier knowing you can just copy it to another computer and run it without needing to add it to the system PATH or (as some of them are before we moved to Windows 7) worry about whether setx exists or not.

    I assume you tried setx /m?



  • I mean, you could just replace your entire build system with a powershell script I guess. Or just call one. But even so, PATH and the registry are entirely the wrong way to go about this. You should be asking the system, not scraping the parts of the system that will hopefully help somewhat.



  • How is PowerShell any different than Python?


  • Discourse touched me in a no-no place

    @mott555 said:

    I suspected the registry was the way to go, but couldn't find the system-wide Environment.

    I've looked it up before for some reason.


  • Discourse touched me in a no-no place

    Are you sure Jenkins is running as who you think it's running as?


  • Discourse touched me in a no-no place

    @Magus said:

    But even so, PATH and the registry are entirely the wrong way to go about this. You should be asking the system, not scraping the parts of the system that will hopefully help somewhat.

    "To programmatically add or modify system environment variables, add them to the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment registry key, then broadcast a WM_SETTINGCHANGE message with lParam set to the string "Environment". This allows applications, such as the shell, to pick up your updates."

    That's straight from the horse's mouth. So watch out how you hold your hand or it might get bit.


  • Discourse touched me in a no-no place

    @mott555 said:

    How is PowerShell any different than Python?

    One's .Net, the other's Python.



  • Perhaps a mod needs to move all this to another topic, it started as a one-off complaint and has apparently now turuned into a serious discussion.

    Looks like it's running as a local system account, the services page is helpfully not telling me which specific account.


  • sockdevs

    @mott555 said:

    MSBuild didn't exist until VS2010...we still do VS2005 and VS2008 and need a way to support them as well.

    MSBuild existed at the time of VS2005; in fact, that's where it first came in



  • Nice, the MSDN page I found shows no MSBuild prior to 2010.

    I'm glad it's Friday.


  • Discourse touched me in a no-no place

    @mott555 said:

    Looks like it's running as a local system account, the services page is helpfully not telling me which specific account.

    It's probably the LocalSystem account, then. Or LocalService.

    They're a bit weird, IIRC. I think they're not fully users, so, for example, they don't don't get HKCU loaded, etc.


  • Discourse touched me in a no-no place

    @mott555 said:

    Nice, the MSDN page I found shows no MSBuild prior to 2010.

    If 2010's the earliest version currently support of Visual Studio, they probably updated the docs. They don't show when it was actually added originally.



  • How loud are you asking me to laugh exactly?

    Seriously, it would be trivial to query this information from Powershell. I don't know how, because I've never done it. But that's what Powershell is for.

    @FrostCat said:

    That's straight from the horse's mouth. So watch out how you hold your hand or it might get bit.

    Yes, you can update the PATH with the registry. That doesn't mean the goal is not flawed in the first place.



  • Jeffed. Someone should come up with a better title though :laughing:



  • Found it, it's Local System, which is the same account used in the Windows 7 build slaves where modifying the PATH works perfectly for all accounts.



  • You're totally pulling a blakey. Making fun of my solutions and dodging questions without offering anything better than "Oh there's probably maybe a better way out there somewhere!" :wink:


  • Discourse touched me in a no-no place

    @mott555 said:

    Found it, it's Local System, which is the same account used in the Windows 7 build slaves where modifying the PATH works perfectly for all accounts.

    If you feel like living dangerously, google LocalSystem, find the MSDN page about the account, and read the comments about logging in as that user.

    Once that's done you can modify the path and see if it sticks, and then write up a front-page article about your actions.



  • @blakeyrat powershell can do this, right?

    @mott555 said:

    Oh there's probably maybe a better way out there somewhere!

    Yes, and I gave you an example of one which was designed for that very purpose. You can go on being wrong, but not about what I've said.



  • You told me to use PowerShell instead of Python. Without more information I don't see how that helps Jenkins know where Inno Setup is installed on its various build slaves, and also sacrifices some of the cross-platform scripting needed for our Linux builds.

    It's the equivalent of "How to I get to Chicago from here?"

    "Use a car, duh!"


  • sockdevs

    MSBuild I believe still supports .sln and .*proj files from as far back as VS2005 (after all, VS basically says 'Hey MSBuild! Here's an .sln, build that shit!')



  • @mott555 said:

    You told me to use PowerShell instead of Python. Without more information I don't see how that helps Jenkins know where Inno Setup is installed on its various build slaves, and also sacrifices some of the cross-platform scripting needed for our Linux builds.

    It's the equivalent of "How to I get to Chicago from here?"

    "Use a car, duh!"

    Just so it's easy to understand, I will give you a list:

    1. Powershell exists to manage this kind of thing
    2. Pash exists
    3. Google exists
    4. We already have a thread that goes into explicit detail on how you're supposed to find things on Windows
    5. If you know a car is available, why are you using a unicycle with a flat wheel?


  • @Magus said:

    why are you using a unicycle with a flat wheel?

    My sides...



  • In this topic:

    "Hey guys, I'm trying to change this variable but my changes aren't being used by the system."

    "WHY THE FUCK ARE YOU USING TECHNOLOGY TO SOLVE PROBLEMS? YOU SHOULD BE USING MICROSOFT :tm: BRAND TECHNOLOGY AND NO OTHER TECHNOLOGY EVER JUST COPY THE DLL TO C:\WINDOWS OMG"

    [cue 100 post flamewar about why you should use system calls that do things the OS shouldn't be concerned with]



  • @Magus said:

    Powershell exists to manage this kind of thing

    But you haven't said how. PowerShell is a scripting language. Python is a scripting language. And I'm confused.

    @Magus said:

    Pash exists

    Petroleum Accountants Society of Houston? Pseudoangiomatous stromal hyperplasia? Some dude from India?

    @Magus said:

    Google exists

    Yes but see my response to point 2. Also, obligatory DiscoBashing, the bullet numbers can't be quoted.

    @Magus said:

    We already have a thread that goes into explicit detail on how you're supposed to find things on Windows

    Link? But if it isn't talking about Jenkins CI it's probably non-sequitur anyway.

    @Magus said:

    If you know a car is available, why are you using a unicycle with a flat wheel?

    TDEMSYR.


  • sockdevs

    @mott555 said:

    Apparently unable to alter the global PATH variable in Windows 8

    Out of interest, have you tried enabling the local Administrator account and changing the PATH in that?



  • This'll probably trigger another flamewar, but the only user account on the system is a local administrator.


  • sockdevs

    @mott555 said:

    a local administrator

    A local administrator, but not the local Administrator; Windows 8 ships with a hidden Administrator account that can be activated for login if you absolutely need it.



  • @Magus said:

    Then use one that isn't stupid?

    Most of them are, at least from the viewpoint of the person you're trying to channel...

    (Or, apparently Blakey has never tried to build something to go on a bare-metal microcontroller :P)



  • @mott555 said:

    @Magus said:
    Powershell exists to manage this kind of thing

    But you haven't said how. PowerShell is a scripting language. Python is a scripting language. And I'm confused.

    Powershell is a scripting language specifically designed to manage servers and such. It's good at getting things out of the system, like bash. Python is designed to be general purpose and cross platform.

    @mott555 said:

    @Magus said:
    Pash exists

    Petroleum Accountants Society of Houston? Pseudoangiomatous stromal hyperplasia? Some dude from India?

    It's like Bash.

    @mott555 said:

    @Magus said:
    Google exists

    Yes but see my response to point 2. Also, obligatory DiscoBashing, the bullet numbers can't be quoted.

    Context. Try some.

    @mott555 said:

    @Magus said:
    We already have a thread that goes into explicit detail on how you're supposed to find things on Windows

    Link? But if it isn't talking about Jenkins CI it's probably non-sequitur anyway.

    Discosearch.

    @mott555 said:

    @Magus said:
    If you know a car is available, why are you using a unicycle with a flat wheel?

    TDEMSYR.

    You're the one who called Powershell a car, and stated that none of the systems you're working with can get the information you need without relying on hacks that interface with DOS compatability.



  • Oh oh.... I got this one.

    Is your computer plugged in?

    Please unplug, then replug in your computer.


  • Discourse touched me in a no-no place

    @FrostCat said:

    That's straight from the horse's mouth.

    Sometimes I think MSDN is the other end of the horse. Lots of information, but all too often not quite useful, usually because of a bunch of assumptions that just don't seem to apply to what I'm doing. It's like I need a map of the area when MSDN keeps telling me about the history of the county's road maintenance department; I suppose I could glean what I need from it but it's not what I want to spend my time doing.

    Sometimes you get lucky though. Not using Bing to search MSDN seems to help. :smile:


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.