Thursday, June 20, 2024

Sharing Touch Portal settings between two PCs

Datatalk + Touch Portal

Though Touch Portal has its own backup mechanism and you can use that to share settings it does take a few clicks and a bit of attention. When you quickly want to share stuff that's not what you want.

I created a few batch files and two buttons to speed things up. Here's my approach.


0. Remember that this is my setup!

You'll have to adjust the paths and modify the batch files to match your setup!


1. In Touch Portal I created two buttons:


(Click image to enlarge.)


2. This button copies the Touch Portal settings and my batch files to a Google Drive folder.


(Click image to enlarge.)

3. When selected I launch a batch file tp_tptogdrive.bat.

  1. rem *** copy touchportal data TO googledrive ***

  2. rem exit touch portal manually, then press any key
  3. pause

  4. rem *** copy touchportal files TO googledrive ***

  5. rmdir c:\googledrive\touchportal\appdata /s
  6. mkdir c:\googledrive\touchportal\appdata
  7. xcopy %appdata%\TouchPortal\ c:\googledrive\touchportal\appdata\ /s

  8. rem *** copy any other files TO googledrive ***

  9. rem I make a copy of my batch files as well as my wallx.cfg file

  10. rmdir c:\googledrive\touchportal\batchfiles /s
  11. mdkir c:\googledrive\touchportal\batchfiles
  12. xcopy c:\software\batch c:\googledrive\touchportal\batchfiles\ /s

  13. rmdir c:\googledrive\touchportal\wallx /s
  14. mkdir c:\googledrive\touchportal\wallx
  15. copy c:\software\utils\wallx.cfg c:\googledrive\touchportal\wallx

  16. rem *** wait for google drive to finish syncing ***

  17. rem check if googledrive is done syncing, then press any key
  18. pause

  19. rem *** clean up ***

  20. c:
  21. cd c:\googledrive\touchportal\appdata
  22. rmdir "pages (1)"
  23. rmdir "pages (2)"
  24. rmdir "pages (3)"
  25. rmdir "pages (4)"
  26. rmdir "icons (1)"
  27. rmdir "icons (2)"
  28. rmdir "icons (3)"
  29. rmdir "icons (4)"
  30. cd ..

  31. start "" /B "C:\Program Files (x86)\Touch Portal\TouchPortal.exe"
  32. exit


This batch file creates a few folders, and copies the Touch Portal settings, as well as all my batch files to Google Drive. You can use it to sync some other stuff.

I didn't share the files through Google Drive directly, but instead use a copy. This allows me a bit more flexibility when configuring, and gives me an additional backup in case of accidental edit mistakes. Also, having TWO copies of Touch Portal (one on each PC) accessing the same config files may confuse Touch Portal.


4. This button copies the Touch Portal settings from the Google Drive folder to the local settings folder.


(Click any image to enlarge.)


5. Here's the associated batch file:

  1. rem *** copy touchportal data FROM googledrive ***

  2. rem exit touch portal manually, then press any key
  3. pause

  4. c:
  5. cd c:\googledrive\touchportal\appdata
  6. rmdir "pages (1)"
  7. rmdir "pages (2)"
  8. rmdir "pages (3)"
  9. rmdir "pages (4)"
  10. rmdir "icons (1)"
  11. rmdir "icons (2)"
  12. rmdir "icons (3)"
  13. rmdir "icons (4)"
  14. cd ..

  15. rmdir %appdata%\TouchPortal /s
  16. mkdir %appdata%\TouchPortal
  17. xcopy c:\googledrive\touchportal\appdata %appdata%\TouchPortal\ /s

  18. rem *** batch files and wallx config are NOT automatically overwritten ***

  19. rem if you need any (newer) batchfiles etc. check this by hand
  20. rem each machine may have customized batch files, don't want to mess them up
  21. rem press any key to continue
  22. pause

  23. start "" /B "C:\Program Files (x86)\Touch Portal\TouchPortal.exe"
  24. exit


This batch file does NOT copy the folder with batch files. I may have modified the batch files to accomodate differences between both PCs (for example, the Google Chrome profiles on both machines are different).

Again, you'll have to adjust the batch file to match your setup!


5. My icons folder resides on the Google Drive.

That way, I have all the icons / images available when changing things. I know Touch Portal keeps a copy of the images, but when you change the pages you might have to modify or change something.

I use WallX to create .JPG files for Touch Portal as it can't handle .ICO files directly.


More


No comments:

Post a Comment