Bug 41375 - Change default icon of desktop folder "Eigene Shares" via netlogon script
Change default icon of desktop folder "Eigene Shares" via netlogon script
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: Netlogon scripts
UCS@school 4.1
Other Linux
: P5 enhancement (vote)
: UCS@school 4.1 R2 v10
Assigned To: Daniel Tröder
Sönke Schwardt-Krummrich
:
Depends on:
Blocks: 43655 43729 45301
  Show dependency treegraph
 
Reported: 2016-05-30 10:25 CEST by Sönke Schwardt-Krummrich
Modified: 2017-08-30 18:53 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): External feedback, Forked for project, Usability
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2016-05-30 10:25:23 CEST
Code snippet from customer that creates an desktop.ini file within the
"Eigene Shares" directory for overriding the folder's default icon.
This makes it more noticable to the students/teachers.

---[cut]---
Const DESKTOP = &H10&
Const FolderName = "Eigene Shares"
Const HIDDEN = 2
CONST SYSTEM = 4

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(DESKTOP)
Set objFolderItem = objFolder.Self
Set FileSysObj = WScript.CreateObject("Scripting.FileSystemObject")

FolderPath = objFolderItem.Path + "" + FolderName
DesktopIniPath = FolderPath + "" + "desktop.ini"

If (FileSysObj.FileExists(DesktopIniPath)) Then
      FileSysObj.DeleteFile DesktopIniPath, True
End If

Set DesktopIniFile = FileSysObj.CreateTextFile(DesktopIniPath, True, True)
DesktopIniFile.WriteLine "[.ShellClassInfo]"
DesktopIniFile.WriteLine "InfoTip=Meine Freigaben im Netzwerk"
DesktopIniFile.WriteLine "IconResource=%SystemRoot%system32\imageres.dll,-143"
DesktopIniFile.Close

Set objFile = FileSysObj.GetFile(DesktopIniPath)
objFile.Attributes = objFile.Attributes OR HIDDEN
Set objFile = FileSysObj.GetFolder(FolderPath)
objFile.Attributes = objFile.Attributes OR SYSTEM
---[cut]---
Comment 1 Jan Christoph Ebersbach univentionstaff 2016-09-12 10:00:29 CEST
Other requirements are:

* Better, customizable names for links to file shares, e.g. "Home-Verzeichnisse Schüler" instead of home_schueler
* Icon for "Meine Dateien" is the user icon
* Icon for other shares is the group icon
* The desktop.ini file should be hidden by default
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2017-02-13 10:46:11 CET
Slightly deviating from our discussion, I would suggest the following:

1) The .ini file is always written.

2) The value of the "IconResource=" entry should be configurable via UCR variables; if the UCR variable is not set, no IconResource entry is written to the file.

3) The UCR variable will only be set (to e.g. "%SystemRoot%system32\imageres.dll,-143") if the UCR variable is unset and starting with UCS@school 4.2 → Please create a new bug for this UCS@school 4.2 change.

4) The name and InfoTip is also configurable via UCR but uses the current values as fallback. → there should be no change in behaviour if the U@S 4.1 R2 v10 update is installed.
Comment 3 Sönke Schwardt-Krummrich univentionstaff 2017-02-13 11:24:23 CET
Just got the hint from the customer, that the "InfoTip" entry does not work most probably.
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2017-02-13 11:25:23 CET
(In reply to Sönke Schwardt-Krummrich from comment #2)
> 3) The UCR variable will only be set (to e.g.
> "%SystemRoot%system32\imageres.dll,-143") if the UCR variable is unset and
> starting with UCS@school 4.2 → Please create a new bug for this UCS@school
> 4.2 change.

We should consider recreating the logon scripts with the update to UCS@school 4.2 to activate this new feature for all users.
Comment 5 Daniel Tröder univentionstaff 2017-02-27 16:30:03 CET
r77127: advisory and code to set the icons. New UCRVs:
* ucsschool/userlogon/shares_folder_icon- default unset
* ucsschool/userlogon/my_files_link_icon- default unset
* ucsschool/userlogon/other_links_icon- default unset
* ucsschool/userlogon/my_files_link_name - default "Eigenen Dateien" 

If the *_icon UCRVs are set, icons will be set for the folders and links. Links are not configured with desktop.ini, but when creating.

ucr set \
ucsschool/userlogon/shares_folder_icon='%SystemRoot%\system32\imageres.dll,143' \
ucsschool/userlogon/my_files_link_icon='%SystemRoot%\system32\imageres.dll,207' \
ucsschool/userlogon/other_links_icon='%SystemRoot%\system32\imageres.dll,193'

Then the UCRVs are unset, the script will not change the icons.
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2017-03-05 23:52:27 CET
(In reply to Daniel Tröder from comment #5)
> r77127: advisory and code to set the icons. New UCRVs:
> * ucsschool/userlogon/shares_folder_icon- default unset
> * ucsschool/userlogon/my_files_link_icon- default unset
> * ucsschool/userlogon/other_links_icon- default unset
> * ucsschool/userlogon/my_files_link_name - default "Eigenen Dateien" 

ucsschool/userlogon/my_files_link_name defaults to "Meine Dateien"
 
> If the *_icon UCRVs are set, icons will be set for the folders and links.
> Links are not configured with desktop.ini, but when creating.

OK

> ucr set \
> ucsschool/userlogon/shares_folder_icon='%SystemRoot%\system32\imageres.dll,
> 143' \
> ucsschool/userlogon/my_files_link_icon='%SystemRoot%\system32\imageres.dll,
> 207' \
> ucsschool/userlogon/other_links_icon='%SystemRoot%\system32\imageres.dll,193'

OK

> Then the UCRVs are unset, the script will not change the icons.

→ OK


OK: code change
OK: functional test
UPDATED: YAML
Comment 7 Sönke Schwardt-Krummrich univentionstaff 2017-03-21 12:35:54 CET
UCS@school 4.1 R2 v10 has been released.

http://docs.software-univention.de/changelog-ucsschool-4.1R2v10-de.html

If this error occurs again, please clone this bug.