Changeset 8577


Ignore:
Timestamp:
10/03/09 08:41:55 (2 years ago)
Author:
azawawi
Message:

[Padre] padre --desktop now creates a desktop shortcut and creates the shell context menu "Edit with Padre"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Padre/script/padre

    r8575 r8577  
    8989if ($DESKTOP) { 
    9090    if ( $^O eq 'MSWin32' ) { 
     91        # Create Padre's Desktop Shortcut 
    9192        require File::Temp; 
    92         my ( $temp, $tempfile ) = File::Temp::tempfile( SUFFIX => '.vbs' ); 
    93         print $temp <<'CODE'; 
     93        my ( $vbs, $vbsfile ) = File::Temp::tempfile( SUFFIX => '.vbs' ); 
     94        print $vbs <<'CODE'; 
    9495' Create a Padre shortcut on the current user's desktop  
    9596Set shell = CreateObject("WScript.Shell") 
     
    102103MsgBox "Padre has created a shortcut on your desktop", vbOKOnly Or vbInformation, "Information" 
    103104CODE 
    104         close $temp; 
    105         system(qq{wscript "$tempfile"}); 
     105        close $vbs; 
     106        system(qq{wscript "$vbsfile"}); 
     107 
     108        # Integrate with registry via regedit... 
     109        # VBScript and registry on vista = Does not work! 
     110        my ($reg, $regfile ) = File::Temp::tempfile( SUFFIX => '.reg' ); 
     111        print $reg <<'REG'; 
     112Windows Registry Editor Version 5.00 
     113 
     114[HKEY_CLASSES_ROOT\*\shell\Edit with Padre] 
     115 
     116[HKEY_CLASSES_ROOT\*\shell\Edit with Padre\Command] 
     117@="c:\\strawberry\\perl\\bin\\padre.exe \"%1\"" 
     118REG 
     119        close $reg; 
     120        system(qq{regedit /S "$regfile"}); 
     121 
    106122    } else { 
    107123        warn "--desktop not implemented for " . $^O . "\n"; 
Note: See TracChangeset for help on using the changeset viewer.