Archive: Could somebody see what is wrong with my script


Could somebody see what is wrong with my script
Could you please look at my script
(At the bottom of the script)

I want that my installer automaticly sets the .ogm extension to open with Media Player Classic


Script Information >>>>>

location "mplayercXP.exe"
$PROGRAMFILES\a-S Codec Pack\mplayercXP.exe


>>This is the IMPORTANT Section of the script<<

;------------------------------------------------

Section

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic XP OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player Classic\mplayercXP.exe\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" \
'$PROGRAMFILES\a-S Media Player Classic\mplayercXP.exe "%1"'
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit" "" "Media Player Classic XP OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit\command" "" \
'$PROGRAMFILES\a-S Media Player Classic\mplayercXP.exe "%1"'
!undef Index
; Rest of script

SectionEnd
;-----------------------------------------------

WHAT IS WRONG??????????????????????????????????


What's the error?


It doesnt give any error. It just dont work


Lobo King did you see my script. Could you take a look at that please and look what is the error THANKS


Sorry it was Lobo Lunar


Could Somebody help me ?????????

question = look above this Thread


Section
;----------------------------------------------------------
!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$SYSDIR\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" \
'$SYSDIR\mplayercXP.exe "%1"'
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit\command" "" \
'$SYSDIR\mplayercXP.exe "%1"'
!undef Index

SectionEnd
;----------------------------------------------------------

Location File "$SYSDIR\mplayercXP.exe"

What is wrong ??????????????????????????????????????????


You don't have to shout every minute. And we also have a button to edit posts.

Try putting quotes around paths with spaces using $\"


Note: The Compiler doesn't give a error (I can run the installer)

but .ogm files will not open with Media Player Classic


what do you mean ???

example please, thanks


It this case, the folder names contain spaces so you should put quotes around the whole path, for example:

"$PROGRAMFILES\a-S Media Player Classic\mplayercXP.exe"


I am getting craZY I dont know why

;----------------------------------------------------------

Section

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" \
'$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe "%1"'
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit\command" "" \
'$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe "%1"'
!undef Index

SectionEnd

;--------------------------------------------------------

What is wrong ????????

The file is in "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe"

and it should set .ogm files to open with "mplayercXP.exe"


Got it allmost it gives a error insted of just skipping it

THIS IS THE ERROR
WriteRegStr expects 4 parameters, got 5.
Usage: WriteRegStr rootkey subkey entry_name new_value_string
root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD)
Error in script "C:\Documents and Settings\GokuSan\Bureaublad\ML + Wind and .NSI" on line 834 -- aborting creation process


and this is line 834 :
"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe "%1"'

what is wrong ??

please write the whole code down


You should quote the path inside the entire parameter:

WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'

Still doesnt work

ERROR :
WriteRegStr expects 4 parameters, got 9. Wind and .NSI" on line 834 -- aborting creation process

SCRIPT
Section


!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" ;,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" \
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit\command" "" \
"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe ; "%1"'
!undef Index

SectionEnd


Line 834 :
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'


WriteRegStr HKCR "mplayercXP.OGMFile\shell" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'


The code you gave me is better but not good enough

ERROR
WriteRegStr expects 4 parameters, got 8.
on line 834 -- aborting creation process


Line 834
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'


You must be copying it wrong. It works fine here.


Nope I dont know why :::

Section

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" ;,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" \
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit\command" "" \
"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe ; "%1"'
!undef Index

SectionEnd

Could you look at this maybe there is something wrong with the other lines


You have a backslash on the line before. That means the next line will be appended to it. Remove the backslash.


ERROR ON LINE 833
;LINE 832
"${Index}-Skip:"
;LINE 833
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" ""

ERROR =
WriteRegStr expects 4 parameters, got 2.
on line 833 -- aborting creation process



ONoTHER ErroR , Man this never stops


WHOLE SCRIPT :

Section

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" ; ,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" ""
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "open" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\edit\command" "" \
"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe "%1"'
!undef Index

SectionEnd


It would have never started had you only changed what's needed.

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
!undef Index


If this is the script code then it isnt right. I can run the installer succsesfully. But when I open .ogm files then it will open with Windows Media Player insted of "mplayercXP.exe"

Section

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
!undef Index

SectionEnd


Have you tried rebootin? Have you made sure Windows Media Player didn't revert the change (open regedit.exe and look under HKCR\.ogm)?


It wont work (it doesnt give a error but it doenst work)

[size=1]Section

DeleteRegKey HKLM "Software\Classes\.ogm\*.*"
!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
!undef Index

SectionEnd

And is this right:
DeleteRegKey HKLM "Software\Classes\.ogm\*.*"


SomeBody help (AND I DONT NEED KICHIK's HELP)


Can you post the values of all relevent registry keys and describe the behavior or error messages when opening the media file?


I want that my installer sets .ogm files to open with
mplayercXP.exe insted of Windows Media Player How do I do that

I Have done this with this script.. I can Run the installer but when I open .ogm files then it still opens with Windows Media Player insted of mplayercXP.exe

Info :
FileName : "mplayercXP.exe"
Directory : "$PROGRAMFILES\a-S Media Player Classic"

Script
Section

!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".ogm" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "mplayercXP.OGMFile" "${Index}-NoBackup"
WriteRegStr HKCR ".ogm" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".ogm" "" "mplayercXP.OGMFile"
ReadRegStr $0 HKCR "mplayercXP.OGMFile" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "mplayercXP.OGMFile" "" "Media Player Classic .OGM File"
WriteRegStr HKCR "mplayercXP.OGMFile\shell" "" "open"
WriteRegStr HKCR "mplayercXP.OGMFile\DefaultIcon" "" "$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe,0"
"${Index}-Skip:"
WriteRegStr HKCR "mplayercXP.OGMFile\shell\open\command" "" '"$PROGRAMFILES\a-S Media Player ClassicXP\mplayercXP.exe" "%1"'
DeleteRegKey HKCU "SOFTWARE\Classes\.ogm"
!undef Index

SectionEnd


VALUE :

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.ogm]
@="mplayercXP.OGMFile"
"backup_val"="Ogg File (*.ogg)"

[HKEY_CLASSES_ROOT\.ogm\ShellEx]

[HKEY_CLASSES_ROOT\.ogm\ShellEx\{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}]
@="{c5a40261-cd64-4ccf-84cb-c394da41d590}"


BEHAVIOR :

If I open the .ogm file then Windows Media Player will pop-up and say that he could not read the file. That is why I need to open it with "mplayercXP.exe"


YO Guys help please !!


I have this problem ......


I want to have a custom Header in my installer (MODERN UI INSTALLER)
And I allready have made a GRAND search in the Web, Manual and Examples.
I found this in the MODERN UI (HeaderBitMap.nsi) example and I want to replace it with a custom one how do I do that ???


I found this :

!define MUI_HEADERIMAGE


sorry I needed to start a new Topic

Just keep this tread in my previous question


THE .ogm Script !!!!!!!!
If you want to download this attached file and look at it and please say what is wrong Please..... :)

I have put some things you must know in the installer :)

You dont have to donwload if you dont want to

I will search in the Web, Forum and Manual if I didnt find anything I will return to the forum and see for any replies ..... :)

Thanks :igor: :o :hang: :cry: :blah: :weird: :eek: :rolleyes: :p :) :( :D :weird: :mad:


I didnt find anything in Google so could you please tell me what to do are or what word I need to use in the Manual