default to 3.0 with all scripts

I'm planning to switch defaults so that the plotting programs and import scripts on the command line are all 3.0.
This includes:

switching the names of some plotting programs (i.e., core_depthplot3.py becomes core_depthplot.py, and core_depthplot.py becomes core_depthplot2.py and is eventually deprecated).

making sure @Caoimhinmg's native import scripts are available in the pip install and on the command line by default (they are currently default in Pmag GUI).  This will probably mean moving them into the programs directory, and perhaps moving the 2.5 scripts into a subdirectory.

If anybody sees a problem with this, let me know.

Hey @moonshoes87 I would request that we keep the 3.0 scripts in the conversion_scripts directory because it would separate them from the very different analysis programs and simply because the programs directory is jam packed with files. Also makes it easier to see which data formats we support at a glance rather than combing the programs directory. I know this means altering the pip install to add this directory to path and possible import issues, but I think it makes sense from a development and usage stand point. I'd also propose sticking the 2.5 scripts in depreciated/conversion_scripts/ so the python imports are similar and that it is obvious the 2.5 model is depreciated as a bonus you can stick programs like core_depthplot2 here too to make things consistent and reduce clutter. Thoughts?

@Caoimhinmg, I can see your overall organizational point.  I agree about moving the 2.5 scripts to a deprecated folder.
The reason I don't want to leave the 3.0 scripts where they are is for the developer install.  Fixing the pip install is trivial and occurs behind the scenes, but the more we separate out programs into different folders, the more lines are required to set the user's path manually.
Right now all that is actually needed is something like this:
PATH=/Users/***/PmagPy/programs:$PATH
export PYTHONPATH=$PYTHONPATH:/Users/***/PmagPy/

But if we separate out programs, we have to add a line for each subfolder that contains programs that should be accessible on the command line.  This is particularly annoying  in Windows.
Organizationally, it could make sense to have a lot more separation in the programs directory, but I dislike the additional install hassle.  @ltauxe, @Caoimhinmg, @Swanson-Hysell ?

@Caoimhinmg, can you tell me what's going on with programs/cit_magic3.py and programs/cit_magic.py?  Should both of those be kept and deprecated in favor of programs/conversion_scripts/cit_magic, or can one be deleted and one deprecated?

So @moonshoes87 you can fix the PATH issue by somewhat throwing caution to the wind and adding all subdirectories of programs to PATH as described here. This is considered somewhat hazardous as it allows malicious ware to add a exe or subdirectory to path without needing sudo and makes it easier to accidentally add malicious ware to PATH. Though this is mostly true for setting a directory to path outside a protected folder in the first place which already happens in most traditional developer installs so it seems like a mote point.
Alternatively we could set up symbolic links that take advantage of the protected directories in PATH and redirect you out of /usr/bin/local or whatever to where you're going. They exist on all platforms described here for Linux and Mac and Windows. This would be more work for us but should make it easier for users trying to set up a dev install as we could automate it to a script.
As to the programs/cit_magic and programs/cit_magic3 can either both be depreciated or cit_magic depreciated and cit_magic3 removed as all it does is translate cit_magic to the 3.0 data model before exporting and was just created to get @Swanson-Hysell's lab up using the 3.0 data model while the framework was being put into place in the GUIs.

The Linux/Unix solution of adding all subdirectories won't work for PATH setting in Windows, unless the user has cygwin or something like that.
I do like the idea of having a dev install script.  That is basically how PmagPy used to be installed pre-pip.  However, we had a lot of trouble setting PATH in a script for windows (@rminnett worked on this) in a way that was consistently successful.  That is why we ended up with the old solution of making a custom PmagPy prompt for Windows.  I will send you the discussion chain where we were struggling with this.
Can you explain a little more how using symlinks would help with this problem?
Thanks for the explanation on cit_magic, I will deprecate cit_magic along with the other upgraded 2.5 scripts and remove cit_magic3.

@Caoimhinmg, I still want to move forward with this one way or another.
Options:

We leave conversion_scripts as is, modify the Cookbook to add another required line for the developer install, and don't worry about people developing on Windows.

We temporarily move conversion_scripts into the main programs directory which keeps the developer install simpler and try to make a dev install script later.

Or something else?
I would like to make a new pip release soon that includes the native 3.0 conversion scripts.  I also want to make sure the 2.5/3.0 difference is organizationally clear so developers like @njarboe  don't waste time barking up the wrong tree.
I am currently focused on usability of Pmag/Magic GUIs and edge cases, then figuring out Canopy Python 3, so making a dev install script is not something I can devote time to right now.  Let me know if you want to work on that now, or have input on one of the other solutions.  Thanks!

@moonshoes87 I agree that we should just do this quick and figure out a better solution later. For now I think we should do option1 as it keeps the structure the way we want it assuming I can create a cross platform install script. Also I can't think of anyone using a Windows dev install right now so that problem is basically null. I've almost got a unix install script done having just taken a quick hack at it, I'll see how troublesome windows is.

@ronshaar I believe is developing on Windows, but he mainly does fixes on Thellier GUI which will not be affected.  I don't think we can ignore Windows for too long.
I've gone ahead and shuffled some things around.  I will update the Cookbook shortly to reflect the temporary developer install instructions, make sure the pip install still works, and make a new pip release.
Also, in making this transition I noticed a few programs that should probably be updated to native 3.0 and incorporated into Pmag GUI: iodp_samples_magic, and huji_sample_magic.  @Caoimhinmg, would you be able to do the 3.0 switchover?  I am happy to plug them into Pmag GUI, but thought you might be the right person for the conversion since you've done a bunch of them already.

I'm working on the Windows script there is some issues with setting environment variables to run python.exe when using .py files and for some reason as @rminnett points out in the email train you sent me there is this ridiculous limit on PATH variable length such that it can only be ~300 characters. I'm also having some issues testing in a VM because of how administrator privileges work.
I noticed iodp_samples_magic, but as far as I can tell it doesn't work on any of the IODP file types I have been given from IODP, found on their website, or have test data for. As such I assumed it had been outmoded for iodp_dscr_magic.py which is described as "converts ODP LIMS discrete sample format files to magic_measurements". The huji_sample_magic was one I previously asked about where I mentioned that I had no useful test data for it and all the test data I had in huji format was convertible with just the new huji_magic.py. This made me assume that this is also an outdated unnecessary script. If you can find me some test data that needs these scripts I'd be happy to convert them quickly.

Ok, keep me posted about the Windows install shenanigans.
That’s right, I forgot.  Well, maybe both of those scripts are unneeded.  I’ll leave them for the moment.

On Apr 14, 2017, at 1:12 PM, Kevin Gaastra<EMAIL_ADDRESS>wrote:
I'm working on the Windows script there is some issues with setting environment variables to run python.exe when using .py files and for some reason as @rminnett https://github.com/rminnett points out in the email train you sent me there is this ridiculous limit on PATH variable length such that it can only be ~300 characters. I'm also having some issues testing in a VM because of how administrator privileges work.
I noticed iodp_samples_magic, but as far as I can tell it doesn't work on any of the IODP file types I have been given from IODP, found on their website, or have test data for. As such I assumed it had been outmoded for iodp_dscr_magic.py which is described as "converts ODP LIMS discrete sample format files to magic_measurements". The huji_sample_magic was one I previously asked about where I mentioned that I had no useful test data for it and all the test data I had in huji format was convertible with just the new huji_magic.py. This made me assume that this is also an outdated unnecessary script. If you can find me some test data that needs these scripts I'd be happy to convert them quickly.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/PmagPy/PmagPy/issues/172#issuecomment-294227519, or mute the thread https://github.com/notifications/unsubscribe-auth/ABwGIrMJjCMRwiUF7PvkYyTvg2587Nt3ks5rv9MhgaJpZM4MzcQL.

Okay, here is what I've come up with for a Windows and Unix combined install script. It's written in python and only uses native libraries. It has worked on both my Linux distro and my Windows VM after removing my manual path setting. My goal in using python was to require python be pre-installed and so it can be more or less maintained by anyone working on the project. It needs more testing, and can be rerun on windows as much as you want but should only be run on Unix once or it can stack up more directories in PATH (still need to fix that). The script must be run from the PmagPy directory and in Windows it needs to be run as an administrator or nothing works, and in windows to get behaviour similar to Unix I need the user to supply the location of their python.exe after the -p flag. I'd ask as many devs (@moonshoes87, @rminnett, @njarboe, @Swanson-Hysell) with as many different distributions and VMs to backup their changes to .bashrc, .bash_profile, and .profile and run the script to test it, or in Windows to save their PATH and PYTHONPATH variables to a text file then run the script and if you need to restore variables run setx PATH %SAVEDPATH% and setx PYTHONPATH %SAVEDPYTHONPATH%. Where you copy and paste those saved PATH variables to replace the above %% place holders. Let me know how it goes and thanks.

Just gave the dev_setup.py script a major update, it mostly works the same, but now has uninstall and reinstall options details on usage can now also be found in documentation accessed by running python dev_setup.py -h. Let me know if anyone runs into any troubles.

Thanks @Caoimhinmg, I'll try to test this out today.

@Caoimhinmg, the dev install script worked for me without a hitch on OS X.
One question, for the Unix install, do you need to duplicate the $PATH information in three places?  Just to make sure it is hit no matter what?  This leads to a very long $PATH, which isn't an operational problem but is annoying for someone who wants to glance at their $PATH and understand what's in it.
I also tried it on a Windows 10 virtual machine, and the install was successful, but the uninstall failed with this error:

Overall, it's looking good!  I did make a few small clarifying edits in the help text.
One last semi-unrelated note: it is better to use this style of link:  https://earthref.org/PmagPy/cookbook/#pip_install, instead of this style:  https://earthref.org/PmagPy/cookbook/#x1-80001.2.1.  The latter can change when the LaTeX is re-compiled, but the customlinks stay the same.  Unfortunately that means that you have to go into PmagPy.tex to find the customlink names, but it is more robust.

@moonshoes87, the duplication of the PATH in the 3 configuration files is done because of the different kinds of bash shells that can run. Login vs. non-login and because of a failure I found when having it tested by a user on OSX. Theoretically .bash_profile shouldn't need to have the lines because it truly is duplication of .profile which is preferable as it is shell type independent, but for some reason it didn't work when tested on OSX. So I added .bash_profile. The add to .bashrc is important because in non-login bash shells it always works even if it isn't always the recommended method for this. Though bash should only read from one....I could alter the added bash code to make sure it doesn't allow duplicates. I'll look into it.
In other news the Windows problem is easily resolved. I simply forgot that Python is unreasonable about using functional programming techniques and therefore doesn't have a empty list case in their reduce function. Should be fixed in next comment.

Also one more side note on that Unix thing, you're actually not supposed to put environment changes in your .bashrc, but if you don't then I have to ask the user to restart their computer to affect changes. This is because .profile is only read in on start up so if you pull and there are directory changes you have to restart to fix it.

All right @moonshoes87 give the dev_setup another go it should no longer duplicate paths in PATH during the Unix install and the Windows uninstall should no longer error.

Hmm, I've never seen anything that says you shouldn't put environment changes in your .bashrc.  Just curious, where does that recommendation come from?  I've always preferred having things in .bashrc so I can make edits and not restart, as you mention.
Also, I still have duplicate paths when installing on Mac even after pulling commit ee7dc9d29835c3c358aefb14784275d5172d0056
I will re-check the Windows uninstall.

Windows install/uninstall works great for me!
The duplicate paths aren't necessarily a huge deal, if it turns out to be a pain to fix.

Darn, @moonshoes87 can you manually remove the edits made to the configuration files by the script and try the unix install again. It is probably just that my uninstaller is not working so great for the old form of the bash code. I had to make a few structural changes to prevent duplicates.
Also the recommendation to not put environment changes in .bashrc is coming from just about every forum I found on the topic (most on StackOverflow of course). For some reason all the answers said the same things put env changes in .profile. I have absolutely no idea why.

That's funny, when I googled around I couldn't find any advice like that.  I guess we're in different google bubbles, somehow ;)
I gave the install/uninstall another try, and I still get duplicates.  I'm not sure why, because your logic looks correct.  Maybe it has to do with exactly when the $PATH s from the .profile, .bashrc, .bash_profile are actually concatenated?
Also, we shouldn't need the main "PmagPy" directory in the $PATH, only in $PYTHONPATH for imports.

Fair point @moonshoes87, I'll remove the PmagPy directory to prevent name space collisions and simplify PATH.
Also here's an answer from one of the StackOverflow posts I found which helped to create this script. He details/links lots of ways to manipulate environment variables and links to another post which goes very in depth on the difference between the 3 standard Unix shell configuration files. It's really quite interesting, and has proved extremely useful.


apoc.export.csv.query() function overwrites the CSV file everytime it executes. Need to append query results to CSV file. Need option to append query results to CSV file instead of overwriting CSV file.

 Issue by ThulasiPaladugu
Tuesday Nov 02, 2021 at 06:23 GMT
Originally opened as https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/2273

Guidelines
Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.
Expected Behavior (Mandatory)
Query results need to append to the CSV file
Actual Behavior (Mandatory)
Overwriting the CSV file while writing to CSV
How to Reproduce the Problem
by calling call apoc.export.csv.query()
Simple Dataset (where it's possibile)
//Insert here a set of Cypher statements that helps us to reproduce the problem

Steps (Mandatory)

Screenshots (where it's possibile)
Specifications (Mandatory)
Currently used versions
Versions

OS: Windows and Linux
Neo4j: 4.3.3
Neo4j-Apoc:<IP_ADDRESS>

Why is appending needed?
One can export to multiple files instead and then easily concat them in the shell.
A bit more input is needed to understand the actual need for such a feature. Based on the information given so far, it seems to me there are reasonably easy work arounds to get the exports of multiple apoc.export.csv.query() calls into one file, eventually.


Series dropdown menu

What should this PR do?
Resolves DEVED-265 by updating our collection list to be a dropdown menu with toggle.
Why are we making this change?
We want to improve navigation within the site and on all pages.
What are the acceptance criteria?

Series list should display in a full-width column above tutorials and ToC.
Series list should include series name and the title of the first tutorial in the series in the header.
Series header should include an icon toggle that, when clicked, reveals a modal with the other tutorial titles in the series.
Toggle should open and close the modal.
The current tutorial in the series should be highlighted.
Mobile styles should look normal.

How should this PR be tested?

Pull request process
Reviewers:

Test functionality using the criteria above.
Offer tips for efficiency, feedback on best practices, and possible alternative approaches and things that may not have been considered.
For shorter, "quick" PRs, use your best judgement on #2.
Use a collaborative approach and provide resources and/or context where appropriate.
Provide screenshots/grabs where appropriate to show findings during review.

Reviewees:

Prefer incremental and appropriately-scoped changes.
Leave a comment on things you want explicit feedback on.
Respond clearly to comments and questions.

Some questions I have for you @ltagliaferri:

How do you feel about the toggle icon?
^^ border on the header?
^^ border on the dropdown modal? Should that be lighter?

Feel good about the toggle icon, I think the border on the dropdown modal can be lighter.

Sweet — thanks!


Readme install doesn't work

Lunar vim.
I use packer for install.
NVIM v0.8.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser
✗ rose-pine/neovim: failed to update

Config code
{
    'rose-pine/neovim',
    as = 'rose-pine',
    config = function()
        vim.cmd('colorscheme rose-pine')
    end
}

I've ran into this issue with a few plugins and I think it has to do with force pushing a commit or similar. Removing the rose-pine folder and re-installing should do the trick :)
rm -rf ~/.local/share/nvim/site/pack/packer/start/rose-pine/

rm -rf ~/.local/share/nvim/site/pack/packer/start/rose-pine/

^ doesn't fixed the issue, full reinstall - worked.


Al/kubernetes

Addin a little bit of testing

@josephmckinsey  'pip install -e.' seems to work in git workflow but 'python setup.py develop' seems to run into package conflicts with new dependencies


Password reset using a code

hi,
I am sending password reset link to the email now, but i want a code to be sent and post that code from frontend to get the password reset page. How can i achieve that?

done


add username text input to UI

people in IRC today didn't realize granary supported individual users. this should hopefully fix that.
cc @EdwardHinkle @aaronpk @cleverdevil @grantcodes

done in fc959c5f0579fe8456a2e7ec9042a4bc7280da4d!


azd up fails to deploy chat service

This issue is for a: (mark with an x)
- [x] bug report -> please search issues before submitting

Describe the issue
When I run azd up (or azd deploy post provisioning), the deployment step fails and I get the below error instead -

Code: AuthorizationFailed
Message: The client<EMAIL_ADDRESS>with object id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' does not have authorization to perform action 'Microsoft.MachineLearningServices/workspaces/datastores/read' over scope '/subscriptions//resourceGroups/rg-contoso-chat-main/providers/Microsoft.MachineLearningServices/workspaces/ai-project-xxxxxx/datastores/workspaceblobstore' or the scope is invalid. If access was recently granted, please refresh your credentials.

I checked that the Azure Ai project resource provisioned contains the necessary permissions.
But I notice that the object id from the error is different than the object id that was used during provisioning and the one with the necessary permissions which explains why I get this error. The object id from the error corresponds to my management tenant and not my home tenant.
I'm not sure why there is a discrepancy in the object ids used in the provisioning step vs the deployment step i.e. why is the deploy step not using the object id from my home tenant but instead using the object id from my managedByTenant?

Minimal steps to reproduce

Log in to az cli using  az login --tenant 'my-tenant-id'
Log in to azd cli using az auth login --tenant-id 'my-tenant-id'
run 'azd up'

'Provisioning Azure resources' and post-provisioning hooks are complete.
'Deploying services (azd deploy)' step starts and terminates with the above error
Expected/desired behavior
Deployment step should be completed and the deployment endpoint should be available
Versions
I run into this error while deploying the 'main' branch version. I get the same error with GH Codespaces and devcontainer within vscode.

I'm experiencing the same issue but I don't think is an issue with the repo. I think the issue is with AZD and the way creds are pass to the python connector.
For now, the way I resolved it was using a SP from the landing tenant.

@jsburckhardt. Yes the issue is with way the AZD assumes home tenant. We reported this issue to AZD team and is been tracked here
https://github.com/Azure/azure-dev/issues/4293

Closing issue since its been reported to AZD.

We reported this issue to AZD tea

after trying the deployment it failed because of a role to cosmos db. Posted the solution I ended doing the use referred here:

@jsburckhardt. Yes the issue is with way the AZD assumes home tenant. We reported this issue to AZD team and is been tracked here Azure/azure-dev#4293


Fix #6122 - LoadAsync does not work

Problem: Our async Select operator was too lazy. The projector delegate was only run when the Current property was accessed, but the code in LoadAsync spins the enumerator without accessing the Current property.
Solution: Change our async Select operator to invoke the projector delegate on MoveNext. This is preferred over accessing Current during LoadAsync because it matches L2O behavior and will prevent future instances of this bug.

@ajcvickers

Can you change the LoadAsync method to use this instead of ToListAsync in EntityFinder when you merge this to dev?

:shipit:


RunTime Error at start of battle

Attempting to run through story mode with the script; I have daemon installed properly and it loads into the battle fine, once the battle starts I get this error though.
I've tried adding "Settings:set("MinSimilarity", 0.5)" without quotations to regular.lua but still the same error.

See #87.
Update to AnkuLua's latest version.

Trial
Pro


Cannot read property 'definePermission' of undefined

I was using angular-permission since a few months ago and I just updated to the new version today and things broke...
I followed the instructions on github to add the 'permission' module BEFORE 'ui.router', and I've also changed my code to inject PermissionStore and use definePermission (instead of the old Permission and defineRole).
Now when I try to run things I keep getting this error: Uncaught TypeError: Cannot read property 'definePermission' of undefined
The error basically happens in my permissionService in the initialize method.
Please take a look at my permissionService using the old version of angular-permission: https://github.com/LansanaCamara/Medium/blob/master/angular/shared/services/permissions.service.js
As you can see, that is using the old 'Permission' and 'defineRole'.
I use that by doing permissionService.initialize() in my main module run block. That worked just fine for me.
I kept the same exact layout except just replaced the 'Permission' with 'PermissionStore', and 'defineRole' with 'definePermission', and now I get the error.
Any help would be greatly appreciated... I don't know why I'm getting this error because I have updated my angular-permission.js and have included it in my gulp scripts, yet keep getting undefined. Even my IDE recognizes PermissionStore.
Thanks!

Ah yes..that fixed the problem. No longer chainable. Thanks.


Need more prompt examples for Chinese

Thanks for your great work. The Kaggle notebook effectively generates the transcription file, and I have tested various samples from the MediaTek-Research/formosaspeech dataset. However, regardless of how I modify the prompt, it continues to transcribe incorrectly. For example, let's look at grandchallenge-1st-round/A0001544.wav in the dev split.
Ground truth

「金金分離」是金管會近期所推動的政策，又被稱為「寶佳條款」，起因於寶佳集團近來插旗多家金融機構，金管會認為，同一大股東在多家銀行擁有一定股權，或握有董事席次，會產生「競業禁止」與「營業秘密外洩」等問題，有必要限制最多只能插旗一家金融機構。

Vanilla Whisper(via HF space https://huggingface.co/spaces/sanchit-gandhi/whisper-large-v2)

金金分離是金管會近期所推動的政策又被稱為保家條款其因與保家集團近來插旗多家金融機構金管會認為同一大股東在多家銀行擁有一定股權或握有董事席次會產生競業禁止與營業秘密外洩等問題有必要限制最多只能插旗一家金融機構

GFD
my prompt file
asr_prompt: "以下是繁體中文轉錄文檔,有下列詞彙: 寶佳集團 寶佳條款"
llm_prompt: "以下是繁體中文轉錄文檔，有下列詞彙: 寶佳集團 寶佳條款"

output

"金金分離是金管會近期所推動的政策又被稱為「保加條款」其因於保加集團近來插旗多家金融機構金管會認為同一大股東在多家銀行擁有一定股權或握有董事席次會產生競業禁止與營業秘密外洩等問題有必要限制最多只能插旗一家金融機構"

I believe the way I prompt is probably incorrect.  Currently the most complete prompt file is atco2-asr-promot.yaml.
However, it's  English.  It would be great if you can provide more prompt example for Chinese audio.

Hi Tim,
Thank you for trying out our model!
We recommend prompting on whisper: target keywords only; prompting on llm: any description phrase.
In addition, we have found a bug that makes the prompt not working as intended.
We have now fixed the bug, would you mind trying this example again? Thanks!


Produce a friendlier message when unit tests are not found

This PR is a fix for issue #103

Since I've got no news from @lopezcaraballoch , I assume this is ok. I'm merging it.


[BUG] Indexing Job Fails ( more details below )

Describe the bug
Running Quickstart.ipynb - Start new indexing job
<Response [200]>
{
    'status_code': 200,
    'index_name': 'test_graph_rag3',
    'storage_name': 'test_graph_rag3',
    'status': 'failed',
    'percent_complete': 12.5,
    'progress': "Workflow 'create_final_covariates' started.",
}

Expected behavior
Indexing should be 100% complete

When an indexing job fails, I find many logs and artefacts on the blob storage that I configured during the installation. I browse to blob_containers{index_name}\reports and find a JSON file that includes the steps that were taken, as well as any errors reported back. You can access this blob interactively using Azure Storage Explorer if you've deployed the solution with the -g switch.

I recently pushed a PR through that renamed the reports directory to logs. I also hooked up the logging to app insights so that it is easier to debug any failed API calls.

@maulik-soni-tfs are you still having an issue? Also, if you've not seen the thread here, definitely check it out.
https://github.com/Azure-Samples/graphrag-accelerator/issues/55#issuecomment-2212369690

Closing as stale


update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap

MOVED.

Please, arrange the script code as a code and / or remove it under the spoiler.

   Very long text.

Let me see if I can figure out how to post it as code, then I’ll move it.
From: Alexandr Chivarzin @.>
Sent: Friday, November 12, 2021 10:26 AM
To: stascorp/rdpwrap @.>
Cc: BrianDent @.>; Author @.>
Subject: Re: [stascorp/rdpwrap] update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap (Issue #1612)
Please, arrange the script code as a code and / or remove it under the spoiler.
Very long text.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/stascorp/rdpwrap/issues/1612#issuecomment-967325434 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5WEGKCWCKMFVKMLFAIYLDULVL3FANCNFSM5H27CMCQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675  or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .   https://github.com/notifications/beacon/AK5WEGM4OOVSNWXX2VSHYLTULVL3FA5CNFSM5H27CMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHGUDN6Q.gif

Interesting, but I think all you need to do is start an elevated CMD session and do the following:
RDPWInst.exe -r
That's it.

I guess I’ll need to try that.
From: affinityv @.>
Sent: Tuesday, November 16, 2021 1:21 PM
To: stascorp/rdpwrap @.>
Cc: BrianDent @.>; Author @.>
Subject: Re: [stascorp/rdpwrap] update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap (Issue #1612)
Interesting, but I think all you need to do is start an elevated CMD session and do the following:
RDPWInst.exe -r
That's it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/stascorp/rdpwrap/issues/1612#issuecomment-970688897 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5WEGJIO4MK5VGUWK3TSYDUMLDLTANCNFSM5H27CMCQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675  or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .   https://github.com/notifications/beacon/AK5WEGPGB3SYDJGUPKWX57TUMLDLTA5CNFSM5H27CMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHHNYTAI.gif

I stopped rdpwrap and deleted the rdpwrap.ini in the Program Files\RDP Wrapper folder.  Then I ran RDPWInst.exe -r and RDPWInst.exe -r -I as admin.  Neither case copied the rdpwrap.ini into the RDP Wrapper folder.  Please see if you get different results.
C:\SHARED\WIN10_SETUP\RDPWRAP_WIN10HOME>rdpwinst -r
RDP Wrapper Library v1.6.2
Installer v2.5
Copyright (C) Stas'M Corp. 2017
[*] Restarting...
[+] TermService found (pid 7900).
[*] No shared services found.
[*] Terminating service...
[*] Starting TermService...
[-] StartService error (code 1056).
[+] Done.
C:\SHARED\WIN10_SETUP\RDPWRAP_WIN10HOME>rdpwinst -r -i
RDP Wrapper Library v1.6.2
Installer v2.5
Copyright (C) Stas'M Corp. 2017
[*] Restarting...
[+] TermService found (pid 2036).
[*] No shared services found.
[*] Terminating service...
[*] Starting TermService...
[-] StartService error (code 1056).
[+] Done.
From: affinityv @.>
Sent: Tuesday, November 16, 2021 1:21 PM
To: stascorp/rdpwrap @.>
Cc: BrianDent @.>; Author @.>
Subject: Re: [stascorp/rdpwrap] update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap (Issue #1612)
Interesting, but I think all you need to do is start an elevated CMD session and do the following:
RDPWInst.exe -r
That's it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/stascorp/rdpwrap/issues/1612#issuecomment-970688897 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5WEGJIO4MK5VGUWK3TSYDUMLDLTANCNFSM5H27CMCQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675  or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .   https://github.com/notifications/beacon/AK5WEGPGB3SYDJGUPKWX57TUMLDLTA5CNFSM5H27CMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHHNYTAI.gif

All you need to do is copy in new INI file the right directory, then do RDPWInst -r to restart RDP. the -r is to do the restart.

btw you are putting a lot of payload in the thread here; better to do the "view on Github" and reply from there (logged in using the browser for Github of course).  Can you please edit the posts above and remove all the mess that email adds? It will be cleaner, that's all.  Thanks.

Deleted.
From: affinityv @.>
Sent: Wednesday, November 17, 2021 12:30 PM
To: stascorp/rdpwrap @.>
Cc: BrianDent @.>; Author @.>
Subject: Re: [stascorp/rdpwrap] update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap (Issue #1612)
btw you are putting a lot of payload in the thread here; better to do the "view on Github" and reply from there (logged in using the browser for Github of course). Can you please edit the posts above and remove all the mess that email adds? It will be cleaner, that's all. Thanks.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/stascorp/rdpwrap/issues/1612#issuecomment-971966680 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5WEGNRNTEKATWZDXUFA3DUMQGC3ANCNFSM5H27CMCQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675  or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .   https://github.com/notifications/beacon/AK5WEGI7PKYUSVCROT4F4JLUMQGC3A5CNFSM5H27CMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHHXQRWA.gif

The rdpwrap.ini file is locked while termservices is running.  You can’t update it.  That’s the whole point of stopping rdpwrap before the copy.
From: affinityv @.>
Sent: Wednesday, November 17, 2021 12:28 PM
To: stascorp/rdpwrap @.>
Cc: BrianDent @.>; Author @.>
Subject: Re: [stascorp/rdpwrap] update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap (Issue #1612)
All you need to do is copy in new INI file the right directory, then do RDPWInst -r to restart RDP. the -r is to do the restart.
—
You are receiving this because you authored the thread.
Reply to this email directly,  https://github.com/stascorp/rdpwrap/issues/1612#issuecomment-971963909 view it on GitHub, or  https://github.com/notifications/unsubscribe-auth/AK5WEGIWLJIZOFKTC6GELKTUMQF33ANCNFSM5H27CMCQ unsubscribe.
Triage notifications on the go with GitHub Mobile for  https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 iOS or  https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub Android.   https://github.com/notifications/beacon/AK5WEGJ4I4LU2XHKSMQZGBTUMQF33A5CNFSM5H27CMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHHXP4BI.gif

Okay, this is a script that I run as an admin user; if there is an rdpwrap.ini on the desktop, it will update it.  If there is no rdpwrap.ini on the desktop, then it will just show what is i place in the program directory.
@echo on

if exist \users\%USERNAME%\desktop\rdpwrap.ini (
    echo "Before copy"
    dir     \users\%USERNAME%\desktop\rdpwrap.ini "\Program Files\RDP Wrapper\rdpwrap.ini"
    echo.
    xcopy \users\%USERNAME%\desktop\rdpwrap.ini "\Program Files\RDP Wrapper"    /FY
    echo.
    echo "After copy"
    dir     "\Program Files\RDP Wrapper\rdpwrap.ini"
    pause
    \bin\rdp-wrk\RDPWInst.exe -r
)

pause

If an update occurs, then I lose my RDP session due to the restart and then I re-connect and can see the output of the process (elevated cmd session).
Granted it doesn't do any checks for running as an administrator.
But everything works perfectly for me, every time.

Original post (moved?) or removed?  Just re-formatted here.  I'll remove it if OP wants it actually removed.
THE FOLLOWING .BAT FILE COMES WITH NO/ZERO SUPPORT.
This script is useful when updating the rdpwrap.ini file when Microsoft makes changes during updates.
This script belongs in the RDPWRAP installer folder. It will stop UMRDPSERVICE, taskkill TERMSERVICE, copy the rdpwrap.ini to the C:\Program Files\RDP WRAPPER\ folder, restart the services, and finally open RDPConf.exe. A small bit of information is written to a .log file.
You must run this .bat as an administrator to stop and start the services. It verifies you are running as an administrator or closes without doing anything. It also checks for the presence of now.exe in the path. now.exe comes from the Server 2003 resource kit. No I do not know where you can currently find it. Feel free to strip these out as they add a bit of clutter.
THE FOLLOWING .BAT FILE COMES WITH NO/ZERO SUPPORT.

REM 1 – THE STRING YOU WERE SEARCHING FOR WAS NOT FOUND.

SET NOWEXISTS=FALSE
NOW TEST | FIND /I "--"
REM ERRORLEVEL=%ERRORLEVEL%
IF %ERRORLEVEL% EQU 0 (
SET NOWEXISTS=TRUE
)

REM THIS SCRIPT REQUIRES ADMINISTRATIVE OR ELEVATED PRIVILEGES.  EXITING IN 4 SECONDS ... | find /i "--"
NOW YOU ARE NOT RUNNING AS AN ADMINISTRATOR. EXITING IN 4 SECONDS ... | find /i "--" > %~dp0%~n0.log
) ELSE (
ECHO YOU ARE NOT RUNNING AS AN ADMINISTRATOR. EXITING IN 4 SECONDS ...
 EXITING IN 4 SECONDS ... > %~dp0%~n0.log
)
PING <IP_ADDRESS> > NUL 2>&1
EXIT /B 1
)
:RUNASADMINISTRATOR

SET STARTINGDATE=%DATE%
IF "%STARTINGDATE:~2,1%" == "/" (
SET MTH=%STARTINGDATE:~0,2%
SET DAY=%STARTINGDATE:~3,2%
SET YR=%STARTINGDATE:~6,4%
) ELSE (
SET MTH=%STARTINGDATE:~4,2%
SET DAY=%STARTINGDATE:~7,2%
SET YR=%STARTINGDATE:~10,4%
)
SET HR=%TIME:~0,2%
SET HR0=%TIME:~0,1%
IF "%HR0%"==" " SET HR=0%TIME:~1,1%
SET MIN=%TIME:~6,2%
ECHO %STARTINGDATE% %STARTINGDATE:~2,1% %YR%-%MTH%-%DAY%.%HR%:%MIN%

REM STOP UMRDPSERVICE AND TERMSERVICE, COPY RDPWRAP.INI AND RESTART
REM NET STOP UMRDPSERVICE ALWAYS STOPS
NET STOP UMRDPSERVICE

REM NET STOP TERMSERVICE WILL NOT ALWAYS STOP
REM NET STOP TERMSERVICE
REM LOOK IN THE TASKLIST FOR TERMSERVICE DLL, THERE IS ONLY ONE, KILL IT USING THE PID
FOR /F "TOKENS=1-3 SKIP=3 DELIMS= " %%A IN ('TASKLIST.EXE /M TERM*') DO (
ECHO A=%%A, B=%%B, C=%%C
TASKKILL /F /PID "%%B"
GOTO :EXITTASKLIST
)
:EXITTASKLIST
IF "%NOWEXISTS%" EQU "TRUE" (
NOW TERMSERVICE WAS KILLED, RDP SESSIONS WILL BE TEMPORARILY DISCONNECTED | find /i "--" >> %~dp0%~n0.log
) ELSE (
ECHO TERMSERVICE WAS KILLED, RDP SESSIONS WILL BE TEMPORARILY DISCONNECTED >> %~dp0%~n0.log
)

REM %~DP0 EXPANDS TO THE DRIVE LETTER AND PATH OF THE BATCH FILE, IT CONTAINS A TRAILING
COPY /Y "%~DP0RDPWRAP.INI" "%PROGRAMFILES%\RDP WRAPPER\RDPWRAP.INI"
NET START TERMSERVICE
NET START UMRDPSERVICE

REM OPEN RDPCONF.EXE TO SEE THE STATUS WITHOUT WAITING
REM %~DP0 EXPANDS TO THE DRIVE LETTER AND PATH OF THE BATCH FILE, IT CONTAINS A TRAILING
START %~dp0rdpconf.exe

EXIT /B 0

REM END OF UPDATE_RDPWRAPINI.BAT

It was the wrong place to put that script.  Deleting it will remove any confusion.
From: affinityv @.>
Sent: Wednesday, November 17, 2021 1:41 PM
To: stascorp/rdpwrap @.>
Cc: BrianDent @.>; Author @.>
Subject: Re: [stascorp/rdpwrap] update_rdpwrapini.bat - replaces the rdpwrap.ini on a running rdpwrap (Issue #1612)
Original post (moved?) or removed? Just re-formatted here. I'll remove it if OP wants it actually removed.
THE FOLLOWING .BAT FILE COMES WITH NO/ZERO SUPPORT.
This script is useful when updating the rdpwrap.ini file when Microsoft makes changes during updates.
This script belongs in the RDPWRAP installer folder. It will stop UMRDPSERVICE, taskkill TERMSERVICE, copy the rdpwrap.ini to the C:\Program Files\RDP WRAPPER\ folder, restart the services, and finally open RDPConf.exe. A small bit of information is written to a .log file.
You must run this .bat as an administrator to stop and start the services. It verifies you are running as an administrator or closes without doing anything. It also checks for the presence of now.exe in the path. now.exe comes from the Server 2003 resource kit. No I do not know where you can currently find it. Feel free to strip these out as they add a bit of clutter.
THE FOLLOWING .BAT FILE COMES WITH NO/ZERO SUPPORT.

REM 1 – THE STRING YOU WERE SEARCHING FOR WAS NOT FOUND.

SET NOWEXISTS=FALSE
NOW TEST | FIND /I "--"
REM ERRORLEVEL=%ERRORLEVEL%
IF %ERRORLEVEL% EQU 0 (
SET NOWEXISTS=TRUE
)
REM THIS SCRIPT REQUIRES ADMINISTRATIVE OR ELEVATED PRIVILEGES.  EXITING IN 4 SECONDS ... | find /i "--"
NOW YOU ARE NOT RUNNING AS AN ADMINISTRATOR. EXITING IN 4 SECONDS ... | find /i "--" > %~dp0%~n0.log
) ELSE (
ECHO YOU ARE NOT RUNNING AS AN ADMINISTRATOR. EXITING IN 4 SECONDS ...
 EXITING IN 4 SECONDS ... > %~dp0%~n0.log
)
PING <IP_ADDRESS> > NUL 2>&1
EXIT /B 1
)
:RUNASADMINISTRATOR
SET STARTINGDATE=%DATE%
IF "%STARTINGDATE:~2,1%" == "/" (
SET MTH=%STARTINGDATE:~0,2%
SET DAY=%STARTINGDATE:~3,2%
SET YR=%STARTINGDATE:~6,4%
) ELSE (
SET MTH=%STARTINGDATE:~4,2%
SET DAY=%STARTINGDATE:~7,2%
SET YR=%STARTINGDATE:~10,4%
)
SET HR=%TIME:~0,2%
SET HR0=%TIME:~0,1%
IF "%HR0%"==" " SET HR=0%TIME:~1,1%
SET MIN=%TIME:~6,2%
ECHO %STARTINGDATE% %STARTINGDATE:~2,1% %YR%-%MTH%-%DAY%.%HR%:%MIN%
REM STOP UMRDPSERVICE AND TERMSERVICE, COPY RDPWRAP.INI AND RESTART
REM NET STOP UMRDPSERVICE ALWAYS STOPS
NET STOP UMRDPSERVICE
REM NET STOP TERMSERVICE WILL NOT ALWAYS STOP
REM NET STOP TERMSERVICE
REM LOOK IN THE TASKLIST FOR TERMSERVICE DLL, THERE IS ONLY ONE, KILL IT USING THE PID
FOR /F "TOKENS=1-3 SKIP=3 DELIMS= " %%A IN ('TASKLIST.EXE /M TERM*') DO (
ECHO A=%%A, B=%%B, C=%%C
TASKKILL /F /PID "%%B"
GOTO :EXITTASKLIST
)
:EXITTASKLIST
IF "%NOWEXISTS%" EQU "TRUE" (
NOW TERMSERVICE WAS KILLED, RDP SESSIONS WILL BE TEMPORARILY DISCONNECTED | find /i "--" >> %~dp0%~n0.log
) ELSE (
ECHO TERMSERVICE WAS KILLED, RDP SESSIONS WILL BE TEMPORARILY DISCONNECTED >> %~dp0%~n0.log
)
REM %~DP0 EXPANDS TO THE DRIVE LETTER AND PATH OF THE BATCH FILE, IT CONTAINS A TRAILING
COPY /Y "%~DP0RDPWRAP.INI" "%PROGRAMFILES%\RDP WRAPPER\RDPWRAP.INI"
NET START TERMSERVICE
NET START UMRDPSERVICE
REM OPEN RDPCONF.EXE TO SEE THE STATUS WITHOUT WAITING
REM %~DP0 EXPANDS TO THE DRIVE LETTER AND PATH OF THE BATCH FILE, IT CONTAINS A TRAILING
START %~dp0rdpconf.exe
EXIT /B 0
REM END OF UPDATE_RDPWRAPINI.BAT
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/stascorp/rdpwrap/issues/1612#issuecomment-972080300 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AK5WEGIR6BZSENR5RPHWJ63UMQONPANCNFSM5H27CMCQ .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675  or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .   https://github.com/notifications/beacon/AK5WEGPVZKIQKYI7QA6MAPLUMQONPA5CNFSM5H27CMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHHYMJLA.gif

Not so sure, but please do the replies via the website and edit out the extra guff from the email!

@BrianDent , I've re-factored the cmd file considerably, let me know what you think.
Using tee via powershell, sleep instead of pings, less shouting in code, functions....
@echo off
rem SETLOCAL here is required to make sure that the change in value
rem of the NOWEXISTS parameter is correct for the cmd file's own
rem environemtn without regard to any value held before invocation
rem and so as the IF statement doesn't use a pre-runtime value.
rem - refer https://ss64.com/nt/delayedexpansion.html
SETLOCAL EnableDelayedExpansion

rem START OF UPDATE_RDPWRAPINI.BAT

rem Version History
rem 20211111 BJD
rem 20211118 AEM re-factored considerably
rem
rem THIS SCRIPT WILL DO THE FOLLOWING:
rem 1) Sets up a log file
rem 2) Checks for availability of NOW.EXE
rem 3) Checks for required EXE files
rem 4) Checks current and new INI files
rem 5) Verifies that cmd session is running with elevated privileges
rem 6) Copy new INI file to program directory
rem 7) Restart RDP Wrapper to effect new INI
rem 8) Start RDPConf

rem NOTES:
rem DOS ENVIRONMENT VARIABLES
rem %~dp0 IS THE DRIVE AND PATH
rem %~n0 IS THE NAME OF THE FILE
rem %~dp0%~n0 IS THE FULL PATH AND NAME
rem %~dp0%~n0.log IS C:\DIRECTORY\FILENAME.log
rem %DATE% %TIME% IS THE DATE AND TIME
rem
rem NOW.EXE IS FROM THE SERVER 2003 RESOURCE KIT WHICH IS DIFFICULT TO FIND
rem - also available from Windows 98 Resource Kit
rem CALLING NOW MESSAGE | find /i "--" > %~DP0%~N0.LOG GIVES YOU DATED ECHOS
rem

rem 1) Sets up a log file
rem Start with empty new log file
set LOG_FILE=%~dp0%~n0.log
if exist %LOG_FILE% del %LOG_FILE%

rem 2) Checks for availability of NOW.EXE
where now.exe > NUL &&set NOWEXISTS=TRUE||set NOWEXISTS=FALSE
call :now "set NOWEXISTS=%NOWEXISTS%"

rem 3) Checks for required EXE files
rem These are required EXEs, adjust for your OWN environment
set RDPCONF=
set RDPWInst=
for /f "usebackq" %%A in (`where "c:\bin\rdp-wrk;d:\bin\rdp-wrk:rdpconf.exe"`) do set RDPCONF=%%A
for /f "usebackq" %%A in (`where "c:\bin\rdp-wrk;d:\bin\rdp-wrk:rdpwinst.exe"`) do set RDPWInst=%%A
if not defined RDPCONF (
	call :now RDPCONF not found
	exit /b 1
)
if not defined RDPWInst (
	call :now RDPWInst not found
	exit /b 1
)
call :now RDPConf:  %RDPCONF%
call :now RDPWInst: %RDPWInst%

rem 4) Checks current and new INI files
rem Other required INI files
set ACTIVE_RDPWRAP_INI="%PROGRAMFILES%\RDP WRAPPER\RDPWRAP.INI"
set NEW_RDPWRAP_INI="%USERPROFILE%\Desktop\rdpwrap.ini"
call :now Active rdpwrap.ini file %ACTIVE_RDPWRAP_INI%
call :now NEW rdpwrap.ini file %NEW_RDPWRAP_INI%
if exist %ACTIVE_RDPWRAP_INI% (
	powershell -Command "dir '%ACTIVE_RDPWRAP_INI%'| tee -a -filepath %LOG_FILE%"
	if exist %NEW_RDPWRAP_INI% (
		powershell -Command "dir '%NEW_RDPWRAP_INI%'| tee -a -filepath %LOG_FILE%"
		powershell -Command "$scriptblock={fc.exe /l '%ACTIVE_RDPWRAP_INI%' '%NEW_RDPWRAP_INI%'};Invoke-Command -scriptblock $scriptblock |tee -a -filepath %LOG_FILE%"
		fc/l %ACTIVE_RDPWRAP_INI% %NEW_RDPWRAP_INI% >NUL && (
			call :now files are the same no work to do, exiting in 4 seconds
			call :sleep 4
			exit /b 1
		) || (
			call :now files are different
		)
	) else (
		call :now No new rdpwrap.ini file to work with, exiting in 4 seconds
		call :sleep 4
		exit /b 1
	)
)

goto do_it

:now
rem append message to log file
(
	if "!NOWEXISTS!" EQU "TRUE" (
		powershell -Command "$scriptblock={now.exe '%*'};Invoke-Command -scriptblock $scriptblock |tee -a -filepath %LOG_FILE%"
	) else (
		powershell -Command "echo '%*'| tee -a -filepath %LOG_FILE%"
	)
)
goto :eof

:sleep
powershell -Command "Start-Sleep -Seconds '%1'"
goto :eof

:do_it
rem FOR INTERACTIVE RUNS, DOESN'T MATTER FROM BATCH CALL
rem...@echo ON

rem 5) Verifies that cmd session is running with elevated privileges
rem THIS SCRIPT REQUIRES ADMINISTRATIVE OR ELEVATED PRIVILEGES.  EXITING IN 4 SECONDS ...
	call :sleep 4
	exit /b 1
)

date/t
time/t

rem 6) Copy new INI file to program directory
echo.
xcopy %NEW_RDPWRAP_INI% %ACTIVE_RDPWRAP_INI%  /FY
echo.

rem 7) Restart RDP Wrapper to effect new INI
echo.
echo "About to restart RDP Wrapper, connection will be lost"
echo.
pause
%RDPWInst% -r

rem 8) Start RDPConf
start %RDPConf%

:end
pause
exit /b 0

rem END OF UPDATE_RDPWRAPINI.BAT

https://www.activexperts.com/admin/reskit/reskit2003/now/

Update on script .... new name, more logging, cleaner
@echo off
rem START OF rdpwrap-update.cmd

rem SETLOCAL here is required to make sure that the change in value
rem of the NOWEXISTS parameter is correct for the cmd file's own
rem environemtn without regard to any value held before invocation
rem and so as the IF statement doesn't use a pre-runtime value.
rem - refer https://ss64.com/nt/delayedexpansion.html
SETLOCAL EnableDelayedExpansion

rem Version History
rem 20211111 BJD
rem 20211118 AEM re-factored considerably
rem
rem THIS SCRIPT WILL DO THE FOLLOWING:
rem 1) Sets up a log file
rem 2) Checks for availability of NOW.EXE
rem 3) Checks for required EXE files
rem 4) Checks current and new INI files
rem 5) Verifies that cmd session is running with elevated privileges
rem 6) Copy new INI file to program directory
rem 7) Restart RDP Wrapper to effect new INI
rem 8) Start RDPConf

rem NOTES:
rem DOS ENVIRONMENT VARIABLES
rem %~dp0 IS THE DRIVE AND PATH
rem %~n0 IS THE NAME OF THE FILE
rem %~dp0%~n0 IS THE FULL PATH AND NAME
rem %~dp0%~n0.log IS C:\DIRECTORY\FILENAME.log
rem %DATE% %TIME% IS THE DATE AND TIME
rem
rem NOW.EXE IS FROM THE SERVER 2003 RESOURCE KIT WHICH IS DIFFICULT TO FIND
rem - also available from Windows 98 Resource Kit
rem CALLING NOW MESSAGE | find /i "--" > %~DP0%~N0.LOG GIVES YOU DATED ECHOS
rem

rem 1) Sets up a log file
rem Start with empty new log file
set LOG_FILE=%~dp0%~n0.log
if exist !LOG_FILE! del !LOG_FILE!

rem 2) Checks for availability of NOW.EXE
where now.exe > NUL &&set NOWEXISTS=TRUE||set NOWEXISTS=FALSE
call :now "set NOWEXISTS=!NOWEXISTS!"

rem 3) Checks for required EXE files
rem These are required EXEs, adjust for your OWN environment
set RDPCONF=
set RDPWInst=
for /f "usebackq" %%A in (
	`where "c:\bin\rdp-wrk;d:\bin\rdp-wrk:rdpconf.exe"`
) do set RDPCONF=%%A
for /f "usebackq" %%A in (
	`where "c:\bin\rdp-wrk;d:\bin\rdp-wrk:rdpwinst.exe"`
) do set RDPWInst=%%A
if not defined RDPCONF (
	call :now RDPCONF not found
	exit /b 1
)
if not defined RDPWInst (
	call :now RDPWInst not found
	exit /b 1
)
call :now RDPConf:  !RDPCONF!
call :now RDPWInst: !RDPWInst!

rem 4) Checks current and new INI files
rem Other required INI files
set ACTIVE_RDPWRAP_INI="%PROGRAMFILES%\RDP WRAPPER\RDPWRAP.INI"
set NEW_RDPWRAP_INI="%USERPROFILE%\Desktop\rdpwrap.ini"
call :now Active rdpwrap.ini file !ACTIVE_RDPWRAP_INI!
call :now NEW rdpwrap.ini file    !NEW_RDPWRAP_INI!
if exist !ACTIVE_RDPWRAP_INI! (
	set FN1=!ACTIVE_RDPWRAP_INI!
	set FN2=!NEW_RDPWRAP_INI!
	powershell -Command ^
		"dir '!FN1!' | tee -a -filepath !LOG_FILE!"
	if exist !NEW_RDPWRAP_INI! (
		powershell -Command ^
			"dir '!FN2!' | tee -a -filepath !LOG_FILE!"
		powershell -Command ^
			"fc.exe /l '!FN1!' '!FN2!' |tee -a -filepath !LOG_FILE!"
		fc/l !FN1! !FN2! >NUL && (
			call :now files are the same no work to do, exiting in 4 seconds
			call :sleep 4
			exit /b 1
		) || (
			call :now files are different
		)
	) else (
		call :now No new rdpwrap.ini file to work with, exiting in 4 seconds
		call :sleep 4
		exit /b 1
	)
)

goto do_it

:now
rem append message to log file
(
	if "!NOWEXISTS!" EQU "TRUE" (
		powershell Invoke-Command ^
			"{now.exe '%*'} | tee -a -filepath !LOG_FILE!"
	) else (
		powershell Invoke-Command ^
			"{echo '%*'}    | tee -a -filepath !LOG_FILE!"
	)
)
goto :eof

:sleep
powershell -Command ^
	"Start-Sleep -Seconds '%1'"
goto :eof

:do_it
rem FOR INTERACTIVE RUNS, DOESN'T MATTER FROM BATCH CALL
rem...@echo ON

rem 5) Verifies that cmd session is running with elevated privileges
rem THIS SCRIPT REQUIRES ADMINISTRATIVE OR ELEVATED PRIVILEGES. MODIFIED FROM:
rem https://stackoverflow.com/QUESTIONS/7985755/HOW-TO-DETECT-IF-CMD-IS-RUNNING-AS-ADMINISTRATOR-HAS-ELEVATED-PRIVILEGES
rem AT IS DEPRECIATED, USE NET SESSION
net session 2>NUL 1> NUL && (
	call :now You are running as an administrator with elevated privileges
) || (
	call :now You are NOT running as an administrator. exiting in 4 seconds ...
	call :sleep 4
	exit /b 1
)

date/t
time/t

rem 6) Copy new INI file to program directory
echo.
xcopy !NEW_RDPWRAP_INI! !ACTIVE_RDPWRAP_INI!  /FY
echo.

rem 7) Restart RDP Wrapper to effect new INI
echo.
call :now  "About to restart RDP Wrapper, with ^`!RDPWInst! -r^` ... connection will be lost"
pause
powershell Invoke-Command ^
	"{!RDPWInst! -r} | tee -a -filepath !LOG_FILE!"
echo.

rem 8) Start RDPConf
call :now  "About to run ^`start !RDPConf!^`"
pause
powershell Invoke-Command ^
	"{start !RDPConf!} | tee -a -filepath !LOG_FILE!"

:end
exit /b 0

rem END OF rdpwrap-update.cmd


Fix controller axis and button model names

Since we removed the state request and use js-side default values, we need to instantiate the right model from the start.

:+1: