#include <winsock.h>
+extern void __wgetmainargs(int *argc, wchar_t ***wargv, wchar_t ***wenviron,
+ int expand_wildcards, int *startupinfo);
+
/*****************************************************************************
* system_Init: initialize winsock and misc other things.
*****************************************************************************/
COPYDATASTRUCT wm_data;
int i_opt, i_data;
char *p_data;
+ wchar_t **wargv, **wenvp;
+ int si = { 0 };
i_data = sizeof(int);
- for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ if( GetVersion() < 0x80000000 )
{
- i_data += sizeof(int);
- i_data += strlen( ppsz_argv[ i_opt ] ) + 1;
- }
+ /* use unicode argv[] for Windows NT and above */
+ __wgetmainargs(&i_opt, &wargv, &wenvp, 0, &si);
+ for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ {
+ i_data += sizeof(int);
+ i_data += WideCharToMultiByte( CP_UTF8, 0,
+ wargv[ i_opt ], -1, NULL, 0, NULL, NULL ) + 1;
+ }
+ p_data = (char *)malloc( i_data );
+ *((int *)&p_data[0]) = *pi_argc - optind;
+ i_data = sizeof(int);
+ for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ {
+ int i_len = WideCharToMultiByte( CP_UTF8, 0,
+ wargv[ i_opt ], -1, NULL, 0, NULL, NULL ) + 1;
+ *((int *)&p_data[i_data]) = i_len;
+ i_data += sizeof(int);
+ WideCharToMultiByte( CP_UTF8, 0, wargv[ i_opt ], -1,
+ &p_data[i_data], i_len, NULL, NULL );
+ i_data += i_len;
+ }
- p_data = (char *)malloc( i_data );
- *((int *)&p_data[0]) = *pi_argc - optind;
- i_data = sizeof(int);
- for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ }
+ else
{
- int i_len = strlen( ppsz_argv[ i_opt ] ) + 1;
- *((int *)&p_data[i_data]) = i_len;
- i_data += sizeof(int);
- memcpy( &p_data[i_data], ppsz_argv[ i_opt ], i_len );
- i_data += i_len;
+ for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ {
+ i_data += sizeof(int);
+ i_data += strlen( ppsz_argv[ i_opt ] ) + 1;
+ }
+
+ p_data = (char *)malloc( i_data );
+ *((int *)&p_data[0]) = *pi_argc - optind;
+ i_data = sizeof(int);
+ for( i_opt = optind; i_opt < *pi_argc; i_opt++ )
+ {
+ int i_len = strlen( ppsz_argv[ i_opt ] ) + 1;
+ *((int *)&p_data[i_data]) = i_len;
+ i_data += sizeof(int);
+ memcpy( &p_data[i_data], ppsz_argv[ i_opt ], i_len );
+ i_data += i_len;
+ }
}
/* Send our playlist items to the 1st instance */
ReadRegStr $0 HKCR "VLC$R0" ""\r
WriteRegStr HKCR "VLC$R0" "" "VLC media file ($R0)"\r
WriteRegStr HKCR "VLC$R0\shell" "" "Play"\r
- WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --one-instance-when-started-from-file "%1"'\r
+ WriteRegStr HKCR "VLC$R0\shell\Play\command" "" '"$INSTDIR\vlc.exe" --started-from-file "%1"'\r
WriteRegStr HKCR "VLC$R0\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
FunctionEnd\r
\r
\r
!macro AddContextMenu EXT\r
WriteRegStr HKCR ${EXT}\shell\PlayWithVLC "" "Play with VLC media player"\r
- WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --no-playlist-enqueue "%1"'\r
+ WriteRegStr HKCR ${EXT}\shell\PlayWithVLC\command "" '$INSTDIR\vlc.exe --started-from-file --no-playlist-enqueue "%1"'\r
\r
WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC "" "Add to VLC media player's Playlist"\r
- WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --one-instance-when-started-from-file --playlist-enqueue "%1"'\r
+ WriteRegStr HKCR ${EXT}\shell\AddToPlaylistVLC\command "" '$INSTDIR\vlc.exe --started-from-file --playlist-enqueue "%1"'\r
!macroend\r
\r
!macro DeleteContextMenu EXT\r
WriteRegStr HKCR Applications\vlc.exe "FriendlyAppName" "VLC media player"\r
WriteRegStr HKCR Applications\vlc.exe\shell\Play "" "Play with VLC"\r
WriteRegStr HKCR Applications\vlc.exe\shell\Play\command "" \\r
- '$INSTDIR\vlc.exe --one-instance-when-started-from-file "%1"'\r
+ '$INSTDIR\vlc.exe --started-from-file "%1"'\r
!insertmacro MacroAllExtensions WriteRegStrSupportedTypes\r
\r
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC" "" "Play with VLC media player"\r
WriteRegStr HKCR "AudioCD\shell\PlayWithVLC\command" "" \\r
- "$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1"\r
+ "$INSTDIR\vlc.exe --started-from-file cdda:%1"\r
WriteRegStr HKCR "DVD\shell\PlayWithVLC" "" "Play with VLC media player"\r
WriteRegStr HKCR "DVD\shell\PlayWithVLC\command" "" \\r
- "$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1"\r
+ "$INSTDIR\vlc.exe --started-from-file dvd:%1"\r
\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrival" "VLCPlayDVDMovieOnArrival" ""\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayDVDMovieOnArrival" "Action" "Play DVD movie"\r
\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrival" "VLCPlayCDAudioOnArrival" ""\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Action" "Play CD audio"\r
- WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --one-instance-when-started-from-file",0'\r
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "DefaultIcon" '"$INSTDIR\vlc.exe --started-from-file",0'\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeProgID" "VLC.CDAudio"\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "InvokeVerb" "play"\r
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\VLCPlayCDAudioOnArrival" "Provider" "VideoLAN VLC media player"\r
WriteRegStr HKCR "VLC.DVDMovie" "" "VLC DVD Movie"\r
WriteRegStr HKCR "VLC.DVDMovie\shell" "" "Play"\r
WriteRegStr HKCR "VLC.DVDMovie\shell\Play\command" "" \\r
- '$INSTDIR\vlc.exe --one-instance-when-started-from-file dvd:%1'\r
+ '$INSTDIR\vlc.exe --started-from-file dvd:%1'\r
WriteRegStr HKCR "VLC.DVDMovie\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
WriteRegStr HKCR "VLC.CDAudio" "" "VLC CD Audio"\r
WriteRegStr HKCR "VLC.CDAudio\shell" "" "Play"\r
WriteRegStr HKCR "VLC.CDAudio\shell\Play\command" "" \\r
- '$INSTDIR\vlc.exe --one-instance-when-started-from-file cdda:%1'\r
+ '$INSTDIR\vlc.exe --started-from-file cdda:%1'\r
WriteRegStr HKCR "VLC.CDAudio\DefaultIcon" "" '"$INSTDIR\vlc.exe",0'\r
\r
SectionEnd\r