Author Topic: Add-ons - "Customize the placesbar" but dont know how to do it!  (Read 13093 times)

0 Members and 1 Guest are viewing this topic.

Offline Tomas_Sweden

  • Sr. Member
  • ****
  • Join Date: Oct 2011
  • Posts: 260
  • Karma: 7
    • View Profile
I tried to add on "customize the placesbar" in the "Tweaking.com - Add On Creator" but i dont know how to do it.

This is for win7, dont know if it works for other OS.

Here is the info about it:

1. Type regedit in RUN dialog box and press Enter. Now goto:
 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\
 
2. Now right-click on "Policies" key and select "New -> Key". It'll create a new key, give it name "comdlg32". Now again right-click on this new "comdlg32" key and select "New -> Key" and give the new key name "Placesbar". So the final key path would be:
 

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar
3. Now select "Placesbar" key and in right-side pane, create a new String value "Place0" and set its value to your desired path. You can set it to a drive like C:\ (make sure you put a slash "\" at last) or you can set it to a particular folder like D:\Wallpapers. You can also use some predefined values to put system elements in Places Bar:
 

MyComputer
 MyDocuments
 MyMusic
 MyPictures
 MyNetworkPlaces
 MyFavorites
 CommonDocuments
 CommonMusic
 CommonPictures
 Desktop
 Printers
 Recent
 ProgramFiles
 
You can set upto 5 places. So to change other default places, create new String values Place1, Place2, Place3 and Place4 and set their value to your desired path.


I have attach a pic approximately how I would like it to be.

Tomas
Dell Laptop XPS L501X Intel i5-560M(2.66GHz), Win 7 Home Prem(SP1) 64 Bit, 4 GB RAM. Samsung SSD 850 PRO 256 GB.

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #1 on: March 05, 2012, 10:21:54 AM »
The add on creator is for creating add ons for the advanced system tweaker program.

What problems are you having with it so far?

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Tomas_Sweden

  • Sr. Member
  • ****
  • Join Date: Oct 2011
  • Posts: 260
  • Karma: 7
    • View Profile
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #2 on: March 05, 2012, 10:52:12 AM »
Yes I know that its for system tweaker program, hehe  :wink:

I didnt explain good enough.

I dont know how to add the "customize the placesbar" so it looks like the program in the picture.

I should have attached this pic instead of the other one.

I dont know what text I should add now!

Tomas
Dell Laptop XPS L501X Intel i5-560M(2.66GHz), Win 7 Home Prem(SP1) 64 Bit, 4 GB RAM. Samsung SSD 850 PRO 256 GB.

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #3 on: March 05, 2012, 01:53:56 PM »
Ah, I haven't made the videos on how to use the add on creator yet. Ever try to make a video with 4 kids in the house? lol

I am out in my office and well make some videos soon.

If I have time today I will try to make a quick add on showing what you need and post it for you :wink:

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Tomas_Sweden

  • Sr. Member
  • ****
  • Join Date: Oct 2011
  • Posts: 260
  • Karma: 7
    • View Profile
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #4 on: March 05, 2012, 09:28:46 PM »
It's cool, do the videos when you have time  :smiley:

Thanks for your help anyway!

Tomas
Dell Laptop XPS L501X Intel i5-560M(2.66GHz), Win 7 Home Prem(SP1) 64 Bit, 4 GB RAM. Samsung SSD 850 PRO 256 GB.

Offline umpio

  • Jr. Member
  • **
  • Join Date: Feb 2012
  • Posts: 58
  • Karma: 9
    • View Profile
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #5 on: March 17, 2012, 01:26:01 PM »
I tried to do this with the help of the already done addons by Shane, but somehow I can't get it to work. Other addons I tried to create worked just fine. The problem is that it won't write the registry key values. If I try the same kays with ".reg" file it will add them.

I also noticed that my internet security (comodo) had registry key protection enabled (it had even the same key protected..). But I disabled it and I still can't get it to work. So now I don't know where the problem might be.. :confused:

Other questions is that when I created text boxes the program offered a "browse" button, but I think it doesn't work yet? It doesn't appear after trying the tweak in the main program.

It's quite easy to learn how to use the addon creator by first looking for your already done add-ons. You could maybe create some "tutorial add-ons" for all major types of tweaks. Videos and other documentation will be also very helpful, but the tool itself is very easy to use!

So here is the code for the tweak:
Code: [Select]
[create_controls_start]
radio(radio1|4398|798|1406|203|False|Enable Tweak)
radio(radio2|4383|1158|1496|248|True|Disable Tweak)
textbox(text3|1188|1638|2922|302|False|text3)
textbox(text1|1188|918|2937|287|False|text1)
textbox(text2|1173|1293|2936|271|False|text2)
textbox(text4|1173|2028|2922|287|False|text4)
textbox(text5|1188|2388|2907|287|False|text5)
label(label1|135|918|1000|255|Place 1:)
label(label2|150|1308|1000|255|Place 2:)
label(label3|150|1668|1000|255|Place 3:)
label(label4|150|2043|1000|255|Place 4:)
label(label5|165|2418|1000|255|Place 5:)
[create_controls_end]

[version_start]1.0.0[version_end]

[author_start]Umpio[author_end]

[authorcontact_start][authorcontact_end]

[authorwebsite_start][authorwebsite_end]

[os_start]vista,2008,7[os_end]

[description_start]Customize the Placesbar:

By this tweak you can change the locations on the placesbar of the Windows file save dialog.

Check places you want to change from 1 to 5. To each place browse for your desired location. After selection hit the apply button.

If you want to revert back to Default locations, select the Default Locations and hit the apply button. This will remove all registry keys made by the tweak.
[description_end]

[reg_start][if] |||radio1||| = true [then]
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar]
"Place0"="|||text1|||"
"Place1"="|||text2|||"
"Place2"="|||text3|||"
"Place3"="|||text4|||"
"Place4"="|||text5|||"
[end if]

[if] |||radio2||| = true [then]
Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar]
[end if][reg_end]

[commands_start][commands_end]

[script_start][script_end]

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #6 on: March 17, 2012, 04:42:44 PM »
Notice that you have the browse button set to false, I set them to true :wink:

textbox(text3|1008|1638|2922|302|True|text3)
textbox(text1|1008|918|2937|287|True|text1)
textbox(text2|1008|1293|2936|271|True|text2)
textbox(text4|1008|2028|2922|287|True|text4)
textbox(text5|1008|2388|2907|287|True|text5)

Also I ran it and the keys are not being made. But if you check your temp dir you will see
tweak.bat and tweak.reg

These are the files the program makes and runs. I checked and they are running. If I run them my self it works. Yet not when ran from the program. Looks like a bug. I will dig into it and find the problem and have a fix for tomorrows update :-)

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #7 on: March 17, 2012, 04:47:08 PM »
Found it.

The program uses psexec.exe to run cmd.exe under the system account.

For some odd reason the reg keys wont take when doing that. Delete psexec.exe from the files folder and when the program runs it will run cmd.exe as normal, and then the reg keys get applied.

I need to find out why the keys are not getting set. I may need to remove psexec.exe. I use it because Windows trusted installer gets in the way. Run something as a system account and it is allowed.

Odd bug. Time to research :-)

Edit:

Might have found the problem. cmd.exe is ran as administrator but I found this

Quote
If your reg-file holds references to HKCU, Hive Key Current User, then this points to the HKCU of user "Admin", because he is the one who executes the regedit command.

so on HKCU it is being applied to the administrator account and not the current logged in user. This is why we dont see the writes. HKLM would still be fine.

Crap, what is the best way to handle this? hhhmmmm

Shane
« Last Edit: March 17, 2012, 04:50:59 PM by Shane »
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #8 on: March 17, 2012, 04:54:51 PM »
OK so I think I have a fix. Let me know what you think.

I will have the program check the tweak for "HKEY_CURRENT_USER" or "HKCU"

If it sees any of these in the tweak it will run the tweak with a normal cmd.exe window. If it doesn't see them it will run them with psexec.exe like normal :wink:

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline umpio

  • Jr. Member
  • **
  • Join Date: Feb 2012
  • Posts: 58
  • Karma: 9
    • View Profile
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #9 on: March 18, 2012, 08:20:05 AM »
Well it's good that you figured it out and that should be the best solution for it.  I started to think that it's a bug on my end! The code for the tweak seemed that it must work, but still the keys didn't want to be written.

About the browse buttons, yes they seem to appear in the main program now. I think I didn't accept them in the first place.. :)

But the second problem is that if I press them it doesn't do anything. Should it open a folder browse window?

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #10 on: March 18, 2012, 11:20:34 AM »
Crap, just checked and the browse isn't working.

Thats odd because it worked when I coded it.

I will get it fixed before I put out v1.0.1 today :-)

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #11 on: March 18, 2012, 12:32:50 PM »
Fixed and v1.0.1 is released :-)

Let me know how the new version goes for you.

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com

Offline umpio

  • Jr. Member
  • **
  • Join Date: Feb 2012
  • Posts: 58
  • Karma: 9
    • View Profile
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #13 on: April 02, 2012, 01:01:12 AM »
One more problem with making this:

I'm using text boxes with browse buttons, but the problem is that If I browse for folder, e.g. C:\Program files, and then try to apply the tweak, it won't work. The reason for it is that the location needs to be "C:\\Program files", with double "\\" backlash in the reg file.

Is there any easy solution for this? Or should I just say "for each location insert double backslash" in the description.

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar]
"Place0"="|||text1|||"
"Place1"="|||text2|||"
"Place2"="|||text3|||"
"Place3"="|||text4|||"
"Place4"="|||text5|||"

EDIT: Another thing is that I tried to make it so it would only add places that are checked.
I did it this way:

Code: [Select]
[if] radio1("enable tweak")=true[then]
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\Placesbar]
[end if]

[if]check1=1[then]
"Place0"="|||text1|||"
[end if]
[if]check2=1[then]
"Place1"="|||text2|||"
[end if]
[if]check3=1[then]
"Place2"="|||text3|||"
[end if]
[if]check4=1[then]
"Place3"="|||text4|||"
[end if]
[if]check5=1[then]
"Place4"="|||text5|||"
[end if]

But it will only add the first "checked" place to the registry. Is it possible to change the behavior of the program to check first all the check boxes and add the content from them if selected, and after that execute the tweak?

But I also figured out how to do the same by using only the radio buttons("change all" and one for each place). But if the "change all" is selected and if some of the boxes are left empty, the program will add the "|||textX|||" to the registry instead of keeping it empty. So the place which location is left empty will then be in the registry PlaceX=|||textX|||.
« Last Edit: April 02, 2012, 03:57:52 AM by umpio »

Offline Shane

  • Top Geek, err uh Dog.
  • Administrator
  • Hero Member
  • *****
  • Join Date: Sep 2011
  • Posts: 9274
  • Location: USA
  • Karma: 137
  • "Knowledge should be shared not hidden."
    • View Profile
    • Tweaking.com
Re: Add-ons - "Customize the placesbar" but dont know how to do it!
« Reply #14 on: April 02, 2012, 12:53:18 PM »
Quote
I'm using text boxes with browse buttons, but the problem is that If I browse for folder, e.g. C:\Program files, and then try to apply the tweak, it won't work. The reason for it is that the location needs to be "C:\\Program files", with double "\\" backlash in the reg file.

That is a problem. A fix for it could be that only for the reg box section that the program looks for and doubles the "\" that it finds in the controls.

Quote
But it will only add the first "checked" place to the registry. Is it possible to change the behavior of the program to check first all the check boxes and add the content from them if selected, and after that execute the tweak?

If you remember the program will only apply the code it finds in the first IF then statement.

I do really need to work on this better. This is the first time I have done if then statements for others to use. I need to have it be able to read multiple statements instead of just applying the code from one of them. :wink:

Shane
PLEASE EDIT YOUR TOPIC AND PUT (SOLVED) IF YOU ARE ALL FIXED.

(My weekends belong to my wife and kids, I will try my best to answer all posts daily during the work week)

(About Shane)
Site Owner, Top Admin, Lead Programmer, Wife & 5 kids, Needs a lot more coffee.

When people ask "Why fix what isn't broken?" I reply "To make it better."
"Only a life lived for others is a life worthwhile"
Honor & Respect is all that matters.

Owner & Programmer of: www.pcwintech.com & www.tweaking.com