Opened 16 years ago

Closed 13 years ago

#52 closed enhancement (fixed)

pkg-apt: handle Start Menu & Desktop links

Reported by: maphew Owned by: maphew
Priority: major Component: Installer
Version: Keywords: apt
Cc: jmckenna, hhayashi

Description

see if we can grab the desktop and startmenu .lnk paths during postinstall and stuff them in etc/postinstall/setup/pkg-foo.gz so they're automatically removed when uninstalled.

Attachments (1)

ctypes-special-folders.py (1.1 KB ) - added by maphew 15 years ago.
use ctypes to list Windows' special folders

Download all attachments as: .zip

Change History (8)

comment:1 by maphew, 15 years ago

Status: newassigned

This is the apt correspendent for ticket #21 "support for localized start menu".

One solution is to use win32com, but that is a big dependancy to add.

from win32com.shell import shell
shell.SHGetSpecialFolderPath(0,shellcon.CSIDL_COMMON_STARTMENU)

-- http://stackoverflow.com/questions/2216173/how-to-get-path-of-start-menus-programs-directory

An alternate solution using ctypes was suggested by Luke Pinner of Australia, but I don't know yet if it will work on localized systems. Can I get some testers to run the attached script?

by maphew, 15 years ago

Attachment: ctypes-special-folders.py added

use ctypes to list Windows' special folders

comment:2 by jmckenna, 15 years ago

Cc: jmckenna hhayashi added

I've run this ticket's python script, on a Windows7 machine in Japanese language, and here is the results:

C:\OSGeo4W\apps\test>ctypes-special-folders.py
35 - AllUsersApplicationData = C:\ProgramData
0 - Desktop = C:\Users\jeff\Desktop
21 - Templates = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Templates
19 - NetHood = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Network Shortcuts

22 - AllUsersStartMenu = C:\ProgramData\Microsoft\Windows\Start Menu
6 - Favorites = C:\Users\jeff\Favorites
9 - SendTo = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\SendTo
26 - ApplicationData = C:\Users\jeff\AppData\Roaming
28 - LocalSettingsApplicationData = C:\Users\jeff\AppData\Local
27 - PrintHood = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Printer Shortcu
ts
2 - Programs = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Start Menu\Progra
ms
20 - Fonts = C:\Windows\Fonts
23 - AllUsersPrograms = C:\ProgramData\Microsoft\Windows\Start Menu\Programs
11 - StartMenu = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Start Menu
25 - AllUsersDesktop = C:\Users\Public\Desktop
31 - AllUsersFavorites = C:\Users\jeff\Favorites
14 - MyVideos = C:\Users\jeff\Videos
33 - Cookies = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Cookies
13 - MyMusic = C:\Users\jeff\Music
7 - Startup = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Start Menu\Program
s\Startup
34 - LocalSettingsHistory = C:\Users\jeff\AppData\Local\Microsoft\Windows\Histor
y
5 - MyDocuments = C:\Users\jeff\Documents
24 - AllUsersStartup = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Star
tup
32 - LocalSettingsTemporaryInternetFiles = C:\Users\jeff\AppData\Local\Microsoft
\Windows\Temporary Internet Files
8 - Recent = C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Recent

comment:3 by maphew, 15 years ago

Jeff do those correspond to what you see in Windows Explorer? For example does C:\Users\jeff\AppData\Roaming\Microsoft\Windows\Start Menu\Programs exist? I had hoped to see kanji or accented characters. (I've never seen a localized asian language computer before, so don't know what it looks like at the file/folder level.Maybe my expectation is erroneous.)

comment:4 by jmckenna, 15 years ago

Yes they correspond to what I see in Windows Explorer. (this test VM is a Windows7-Japan install, with English language character support installed...and before i installed the english support I could still see the usual paths in Windows Explorer)

comment:5 by maphew, 15 years ago

Luke Pinner's module in svn as winspecialfolders.py, and is now used by apt.py (r1138). It should probably be put in pythonpath somewhere so it could be available to other programs. I don't know where's the best place for it.

comment:6 by maphew, 15 years ago

Implemented in r1151. Works for me, but definitely should get more testing, especially in collaborative mode: e.g. if package is installed with apt, does uninstalling with setup.exe also delete the menu and desktop links? The file path convention for links are windows and absolute (C:\o4w\etc) while the rest are unix and relative (etc/).

Just the necessary part of Luke's winspecialfolders.py is embedded, to keep it in a single file.

comment:7 by maphew, 13 years ago

Resolution: fixed
Status: assignedclosed

this has been working well for quite awhile and no issues reported, so I'm closing the ticket.

Note: See TracTickets for help on using tickets.