1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-05 20:34:07 +02:00

Add desktop paths to MigrationManager for lnk editing

This commit is contained in:
chylex 2016-04-10 17:51:18 +02:00
parent d7a0f577d6
commit 0d2681c5ba

View File

@ -89,15 +89,25 @@ private static bool BeginMigration(MigrationDecision decision, Action<Exception>
runningProcess.Close();
}
// update the pinned taskbar lnk if exists
string linkFile = Path.Combine(Environment.ExpandEnvironmentVariables(@"%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"),"TweetDeck.lnk");
// update the lnk files wherever possible (desktop icons, pinned taskbar)
string[] locations = {
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory),
Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory),
Environment.ExpandEnvironmentVariables(@"%APPDATA%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar")
};
if (File.Exists(linkFile)){
LnkEditor lnk = new LnkEditor(linkFile);
lnk.SetPath(Application.ExecutablePath);
lnk.SetWorkingDirectory(Environment.CurrentDirectory);
lnk.SetComment("TweetDick"); // TODO add a tagline
lnk.Save();
foreach(string location in locations){
string linkFile = Path.Combine(location,"TweetDeck.lnk");
if (File.Exists(linkFile)){
LnkEditor lnk = new LnkEditor(linkFile);
lnk.SetPath(Application.ExecutablePath);
lnk.SetWorkingDirectory(Environment.CurrentDirectory);
lnk.SetComment("TweetDick"); // TODO add a tagline
lnk.Save();
File.Move(linkFile,Path.Combine(location,"TweetDick.lnk"));
}
}
// uninstall in the background