Skip to content

Commit

Permalink
Snapshot: v0.3, Mar 26 2011
Browse files Browse the repository at this point in the history
  • Loading branch information
mazmazz committed Feb 16, 2019
1 parent b1a2d6f commit 7c9db93
Show file tree
Hide file tree
Showing 28 changed files with 405 additions and 141 deletions.
8 changes: 8 additions & 0 deletions Common/Defaults/PinShortcut.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ verbCommand = args.Item(0)
lnkFolder = args.Item(1)
lnkFilename = args.Item(2)

verbPinStart =

' Default
' shell32.dll
' 5381 - Pin to Start Men&u
' 5382 - Unpin from Start Men&u
' 5386 - Pin to Tas&kbar
' 5387 - Unpin from Tas&kbar

verbName = "Pin to Taskbar"
If verbCommand = "/pinStart" Then verbName = "Pin to Start Menu"
If verbCommand = "/pinTaskbar" Then verbName = "Pin to Taskbar"
Expand Down
10 changes: 10 additions & 0 deletions NSISInstaller/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
If you are upgrading or reinstalling, close the Jumplist Extender tray icon first.

===VERSION 0.3===
Version 0.3 is a '''MAJOR BUG FIX''' release.

''FIXED:''
* '''Non-English systems would not apply jump lists to the taskbar.'''
* Broken update check would display weird code in the menus.
* Old web links were broken.

===Version 0.2-C===
Version 0.2-C is a '''MINOR BUG FIX''' release.

Expand Down
22 changes: 12 additions & 10 deletions NSISInstaller/MainInstall.iss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[Setup]
OutputBaseFilename=JumplistExtender_v0.2-B
VersionInfoVersion=0.2.3
VersionInfoProductVersion=0.2.3
AppVerName=Version 0.2-C
AppVersion=0.2-C
OutputBaseFilename=JumplistExtender_v0.3
VersionInfoVersion=0.3.0
VersionInfoProductVersion=0.3.0
AppVerName=Version 0.3
AppVersion=0.3
VersionInfoCompany=Marco Zafra
VersionInfoDescription=A custom jumplist creator for any program on Windows 7
VersionInfoCopyright=Released under GPLv3
Expand All @@ -18,9 +18,9 @@ ChangesAssociations=true
RestartIfNeededByRun=true
SetupIconFile=PrimaryIcon.ico
AppPublisher=Marco Zafra
AppPublisherURL=http://jumplist.gsdn-media.com
AppSupportURL=http://jumplist.gsdn-media.com
AppUpdatesURL=http://jumplist.gsdn-media.com
AppPublisherURL=http://code.google.com/p/jumplist-extender
AppSupportURL=http://code.google.com/p/jumplist-extender
AppUpdatesURL=http://code.google.com/p/jumplist-extender
AppID={{2D5349D5-167D-4D27-BD8C-9117A6C63FED}
UninstallDisplayName=Jumplist Extender
DefaultDirName={pf}\JumplistExtender
Expand All @@ -32,6 +32,8 @@ AlwaysUsePersonalGroup=true
;Name: {app}\T7EPreferences.exe; Type: files
;Name: {app}\T7EBackground.exe; Type: files
;Name: {app}\NSISInstaller.exe; Type: files
Type: files; Name: "{commonstartup}\Jumplist Extender Applicator.lnk"
Type: files; Name: "{userstartup}\Jumplist Extender Applicator.lnk"

[Files]
;------ add IssProc (Files In Use Extension)
Expand All @@ -44,17 +46,17 @@ Source: Files\Defaults\Icons\*; DestDir: {app}\Defaults\Icons; Flags: recursesub
[Icons]
Name: {group}\Jumplist Extender; Filename: {app}\T7EPreferences.exe; WorkingDir: {app}; Comment: Create custom jumplists for any program on Windows 7.; IconIndex: 0
Name: {app}\Defaults\Icons\[00] shell32.dll; Filename: {sys}\shell32.dll
Name: {userstartup}\Jumplist Extender Applicator; Filename: {app}\T7EBackground.exe; WorkingDir: {app}

[Registry]
Root: HKCR; Subkey: .jlp; ValueType: string; ValueName: ; ValueData: JumplistPack; Flags: uninsdeletevalue
Root: HKCR; Subkey: JumplistPack; ValueType: string; ValueName: ; ValueData: Jumplist Pack; Flags: uninsdeletekey
Root: HKCR; Subkey: JumplistPack\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\T7EPreferences.exe,0
Root: HKCR; Subkey: JumplistPack\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\T7EPreferences.exe"" ""%1"""
Root: HKCU; Subkey: Software\Microsoft\Windows\CurrentVersion\Run; ValueType: string; ValueName: JumplistWatcher; ValueData: {app}\T7EBackground.exe; Flags: uninsdeletekey


[Run]
Filename: {app}\NSISInstaller.exe; Parameters: /inst:{{90fd0530-b663-4fe7-9291-189031b47993}; StatusMsg: Applying jump list settings; Flags: runminimized runasoriginaluser
Filename: {app}\NSISInstaller.exe; Parameters: /inst:{{90fd0530-b663-4fe7-9291-189031b47993}; StatusMsg: Applying jump list settings; Flags: runascurrentuser runhidden
Filename: {app}\T7EBackground.exe; WorkingDir: {app}; Flags: runasoriginaluser nowait
Filename: {app}\T7EPreferences.exe; WorkingDir: {app}; Description: Start Jumplist Extender; Flags: postinstall runasoriginaluser nowait

Expand Down
1 change: 1 addition & 0 deletions NSISInstaller/NSISInstaller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<PropertyGroup>
<PostBuildEvent>rmdir /s /q "$(ProjectDir)Files"
if "$(ConfigurationName)"=="Release" xcopy "$(SolutionDir)bin\Release\*" "$(ProjectDir)Files" /e /y /i /exclude:$(ProjectDir)NSISInstaller_Build_Exclude.txt
echo Install Marker -- Delete to make JLE portable, but be careful NOT to do this to your installation! (i.e. make sure JLE can write to this directory without admin privileges.) &gt; "$(ProjectDir)Files\INSTALLED"
if "$(ConfigurationName)"=="Release" "%25programfiles(x86)%25\Inno Setup 5\ISCC.exe" "$(ProjectDir)MainInstall.iss"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
2 changes: 2 additions & 0 deletions NSISInstaller/NSISInstaller_Build_Exclude.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.lnk
.pdb
.locked
.vshost.exe
32 changes: 32 additions & 0 deletions NSISInstaller/PinShortcut.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Const CSIDL_COMMON_PROGRAMS = &H17
Const CSIDL_PROGRAMS = &H2

Set args = WScript.Arguments
verbCommand = args.Item(0)
lnkFolder = args.Item(1)
lnkFilename = args.Item(2)

verbPinStart =

' Default
' shell32.dll
' 5381 - Pin to Start Men&u
' 5382 - Unpin from Start Men&u
' 5386 - Pin to Tas&kbar
' 5387 - Unpin from Tas&kbar

verbName = "Pin to Taskbar"
If verbCommand = "/pinStart" Then verbName = "Pin to Start Menu"
If verbCommand = "/pinTaskbar" Then verbName = "Pin to Taskbar"
If verbCommand = "/unpin" AND InStr(lnkFolder, "StartMenu") > 0 Then verbName = "Unpin from Start Menu"
If verbCommand = "/unpin" AND InStr(lnkFolder, "TaskBar") > 0 Then verbName = "Unpin from Taskbar"

WScript.Echo lnkFolder & " | " & lnkFilename & " | " & verbName & " || "

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(lnkFolder)
Set objFolderItem = objFolder.ParseName(lnkFilename)
Set colVerbs = objFolderItem.Verbs
For Each objVerb in colVerbs
If Replace(objVerb.name, "&", "") = verbName Then objVerb.DoIt
Next
71 changes: 48 additions & 23 deletions NSISInstaller/Primary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void SetAppIdBackAfterJumplist()
{
Title = "Visit the official website",
Path = "%windir%\\explorer.exe",
Arguments = "\"http://jumplist.gsdn-media.com\"",
Arguments = "\""+Common.WebPath_OfficialSite+"\"",
IconReference = new IconReference(Path.Combine(Common.EnvPath_SystemRoot, "system32\\shell32.dll"), 135)
});
ownList.Refresh();
Expand Down Expand Up @@ -180,9 +180,19 @@ private void InstallJLE()
if (File.Exists(Path.Combine(Common.Path_AppData, "Icons\\[00] shell32.dll")))
File.Delete(Path.Combine(Common.Path_AppData, "Icons\\[00] shell32.dll"));

if (File.Exists(Path.Combine(Common.Path_ProgramFiles, "PinShortcut.vbs")))
File.Delete(Path.Combine(Common.Path_ProgramFiles, "PinShortcut.vbs"));

if (File.Exists(Path.Combine(Common.Path_AppData, "UpdateCheck2.txt")))
File.Delete(Path.Combine(Common.Path_AppData, "UpdateCheck2.txt"));

if (File.Exists(Path.Combine(Common.Path_AppData, "UpdateCheck.txt")))
File.Delete(Path.Combine(Common.Path_AppData, "UpdateCheck.txt"));

// Copy files to AppData, if needed
string appDataDir = Common.Path_AppData;
string programFilesDir = Common.Path_ProgramFiles;
//MessageBox.Show(appDataDir);
if (!Directory.Exists(appDataDir))
{
try { Directory.CreateDirectory(appDataDir); }
Expand Down Expand Up @@ -916,38 +926,53 @@ public void AssignAppIdsToWindow(IntPtr hWnd)
[DllImport("user32.dll")]
static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);

public string GetStringResource(IntPtr hModuleInstance, uint uiStringID)
{
StringBuilder sb = new StringBuilder(255);
Interop.LoadString(hModuleInstance, uiStringID, sb, sb.Capacity + 1);
return sb.ToString();
}

private void UnpinShortcut(string lnkPath)
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cscript.exe";
startInfo.Arguments = "\"" + Path.Combine(Common.Path_ProgramFiles, "PinShortcut.vbs") + "\" /unpin \"" + Path.GetDirectoryName(lnkPath) + "\" \"" + Path.GetFileName(lnkPath) + "\"";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;

Process pinProcess = new Process();
pinProcess.StartInfo = startInfo;
pinProcess.Start();
pinProcess.WaitForExit();
// Unpinning shortcuts is under UnpinShortcut()
IntPtr shell32Module = Interop.GetModuleHandle("shell32.dll");

string command;
if (lnkPath.Contains("StartMenu"))
command = GetStringResource(shell32Module, 5382); // Unpin from Start Men&u
else
command = GetStringResource(shell32Module, 5387); // Unpin from Tas&kbar

int iRetVal;
iRetVal = (int)Interop.ShellExecute(
this.Handle,
command,
lnkPath,
"",
"",
Interop.ShowCommands.SW_HIDE);
}

private void PinShortcut(string lnkPath, bool pinStartMenu)
{
// Unpinning shortcuts is under UnpinShortcut()
IntPtr shell32Module = Interop.GetModuleHandle("shell32.dll");


string command;
if (pinStartMenu)
command = "/pinStart";
command = GetStringResource(shell32Module, 5381); // Pin to Start Men&u
else
command = "/pinTaskbar";

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "cscript.exe";
startInfo.Arguments = "\"" + Path.Combine(Common.Path_ProgramFiles, "PinShortcut.vbs") + "\" " + command + " \"" + Path.GetDirectoryName(lnkPath) + "\" \"" + Path.GetFileName(lnkPath) + "\"";
startInfo.WindowStyle = ProcessWindowStyle.Hidden;

Process pinProcess = new Process();
pinProcess.StartInfo = startInfo;
pinProcess.Start();
pinProcess.WaitForExit();
command = GetStringResource(shell32Module, 5386); // Pin to Tas&kbar

int iRetVal;
iRetVal = (int)Interop.ShellExecute(
this.Handle,
command,
lnkPath,
"",
"",
Interop.ShowCommands.SW_HIDE);
}
}
}
6 changes: 4 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

INTRO

Thanks for downloading the Jumplist Extender (J7E) v1.0 source! J7E is written primarily in C#, and its contents consist of:
Thanks for downloading the Jumplist Extender (JLE) v0.3 source! JLE is written primarily in C#, and its contents consist of:

/T7EBackground - The background process that assigns windows to their jumplists

Expand All @@ -33,6 +33,8 @@ Thanks for downloading the Jumplist Extender (J7E) v1.0 source! J7E is written p

The main solution will build into /bin, with everything you need to run the complete program.

To build an installation file, first install InnoSetup 5 or later. Then build NSISInstaller /by itself/ to activate the post-build actions that produce the install. (For some reason, it does not work when building the whole solution.)


LICENSE

Expand All @@ -56,7 +58,7 @@ You can download the C++ source at http://www.autohotkey.com/download/

WARNING

Jumplist Extender v1.0's source is VERY, VERY messy! Explore at your own peril!
Jumplist Extender v0.3's source is VERY, VERY messy! Explore at your own peril!

Code cleanup is on the roadmap for v2.0.

Expand Down
19 changes: 13 additions & 6 deletions T7EBackground/Primary.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7c9db93

Please sign in to comment.