Versehentlich gelöschte '.exe'-Dateizuordnung in Nullsoft-Skript?

433
audiFanatic

Ich habe versehentlich die `.exe-Dateizuordnung mit dem folgenden Nullsoft-Skript geändert (generiert von VBConverter )

# MyProg-Standard.nsi installation script # Automatically generated by VB6Converter by David Nuttall # VB6Converter was compiled on 15/02/08 #  Name "MyProg-Standard-Setup" OutFile "MyProg-Standard-Setup.exe" RequestExecutionLevel admin SetCompress auto SetCompressor /SOLID /FINAL Lzma WindowIcon on AutoCloseWindow false SetDatablockOptimize on CRCCheck on InstProgressFlags smooth SetDateSave on AllowSkipFiles on SetOverwrite IfNewer InstallDir "$ProgramFiles\MyProg"  !include Library.nsh  Page Directory Page Components Page InstFiles  Var ALREADY_INSTALLED Var Version  Section "MyProg-Standard" SectionIn 1 RO ;LogSet on # Needs special build of NSIS to actually work. # Change the registry structure to reflect the directory structure you are using. ReadRegDWord $Version HKLM "Software\VBGenerator\MyProg-Standard" Version IfErrors new_installation StrCpy $ALREADY_INSTALLED 1 new_installation:  SetOutPath "$InstDir" File /a "Support\license.txt" !insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\mesa.dll" "$SysDir\mesa.dll" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\cwui.ocx" "$SysDir\cwui.ocx" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\MSWINSCK.OCX" "$SysDir\MSWINSCK.OCX" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\cwanalysis.ocx" "$SysDir\cwanalysis.ocx" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\comct332.ocx" "$SysDir\comct332.ocx" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\MSCOMM32.OCX" "$SysDir\MSCOMM32.OCX" "$SysDir" !insertmacro InstallLib DLL NOTSHARED REBOOT_PROTECTED \ "Support\RICHED32.DLL" "$SysDir\RICHED32.DLL" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\RICHTX32.OCX" "$SysDir\RICHTX32.OCX" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\mscomct2.ocx" "$SysDir\mscomct2.ocx" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\MSCOMCTL.OCX" "$SysDir\MSCOMCTL.OCX" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\comdlg32.ocx" "$SysDir\comdlg32.ocx" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\TABCTL32.OCX" "$SysDir\TABCTL32.OCX" "$SysDir" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\USB_DLL.dll" "$SysDir\USB_DLL.dll" "$SysDir" SetOutPath "$InstDir" File /a "Support\MyProg_NXPUSB.exe"  # Put shortcuts in the start menu CreateDirectory "$SMPrograms\MyProg" CreateShortCut "$SMPrograms\MyProg\MyProg.lnk" "$InstDir\MyProg_NXPUSB.exe" WriteRegDWord HKLM "Software\VBGenerator\MyProg-Standard" Version 1 WriteUninstaller "$InstDir\uninstaller.exe" CreateShortCut "$SMPrograms\Uninstall MyProg-Standard.lnk" "C:\svn\projects\Standard_MyProg_NXPUSB\GUI\REV_M_Hardware\SWD0015-XXX\Package (3)\uninstaller.exe" # Set file extension to open the program. WriteRegStr HKCR ".exe" "" "MyProg-Standard file" WriteRegStr HKCR "MyProg-Standard file" "" "MyProg-Standard Document" WriteRegStr HKCR "MyProg-Standard file\DefaultIcon" "" "$InstDir\MyProg_NXPUSB.exe,1" WriteRegStr HKCR "MyProg-Standard file\shell\open\" "" "&Open" WriteRegStr HKCR "MyProg-Standard file\shell\open\command" "" '"$InstDir\MyProg_NXPUSB.exe" "$$1"' # Add uninstaller information to registry. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProg-Standard" "DisplayName" "MyProg-Standard" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProg-Standard" "UninstallString" '"$InstDir\uninstaller.exe"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProg-Standard" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MyProg-Standard" "NoRepair" 1 SectionEnd  Section Uninstall # Remove file extension to open the program. DeleteRegKey HKCR ".exe" DeleteRegKey HKCR "MyProg-Standard file" Delete /RebootOk "$SMPrograms\MyProg\MyProg.lnk" UnRegDLL "$InstDir\MyProg_NXPUSB.exe" Delete /RebootOk "$InstDir\MyProg_NXPUSB.exe" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\USB_DLL.dll" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\TABCTL32.OCX" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\comdlg32.ocx" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\MSCOMCTL.OCX" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\mscomct2.ocx" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\RICHTX32.OCX" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\RICHED32.DLL" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\MSCOMM32.OCX" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\comct332.ocx" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\cwanalysis.ocx" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\MSWINSCK.OCX" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\cwui.ocx" !insertmacro UnInstallLib REGDLL SHARED REBOOT_PROTECTED "$SysDir\mesa.dll" Delete /RebootOk "$InstDir\license.txt" Delete /RebootOk "$SMPrograms\\Uninstall .lnk" RMDir "$SMPrograms\" DeleteRegKey HKLM "Software\VBGenerator\MyProg-Standard" SetOutPath "\" ;Change to root directory to allow the next step to succeed. RmDir /RebootOk "$INSTDIR" SectionEnd  Section "-Install VB6 runtimes" ;Add code here that sets $ALREADY_INSTALLED to a non-zero value if" ;the application is already installed. For example:  IfFileExists "C:\svn\projects\Standard_MyProg_NXPUSB\GUI\REV_M_Hardware\SWD0015-XXX\Package (3)\MyProg-Standard.nsi.exe" 0 new_installation2 StrCpy $ALREADY_INSTALLED 1 new_installation2:  !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED \ "Support\msvbvm60.dll" "$SYSDIR\msvbvm60.dll" "$SYSDIR" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\oleaut32.dll" "$SYSDIR\oleaut32.dll" "$SYSDIR" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\olepro32.dll" "$SYSDIR\olepro32.dll" "$SYSDIR" !insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\comcat.dll" "$SYSDIR\comcat.dll" "$SYSDIR" !insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\asycfilt.dll" "$SYSDIR\asycfilt.dll" "$SYSDIR" !insertmacro InstallLib TLB $ALREADY_INSTALLED REBOOT_PROTECTED \ "Support\stdole2.tlb" "$SYSDIR\stdole2.tlb" "$SYSDIR" SectionEnd  Section "-un.Uninstall VB6 runtimes" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\msvbvm60.dll" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\oleaut32.dll" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\olepro32.dll" !insertmacro UnInstallLib REGDLL SHARED NOREMOVE "$SYSDIR\comcat.dll" !insertmacro UnInstallLib DLL SHARED NOREMOVE "$SYSDIR\asycfilt.dll" !insertmacro UnInstallLib TLB SHARED NOREMOVE "$SYSDIR\stdole2.tlb" SectionEnd 

Ich nehme an, was ich getan habe, als ich nach der Dateizuordnung im VB Converter-Tool gefragt wurde, steckte ich nur dort die .exe-Datei ein und verstand nicht wirklich, wonach sie gefragt wurde (vor allem, da mein Programm keine Dateizuordnungen hat) und dies ist das Ergebnis . Ich vermute, dass die Schuldigen die folgenden Zeilen sind:

# Remove file extension to open the program. DeleteRegKey HKCR ".exe" DeleteRegKey HKCR "MyProg-Standard file" Delete /RebootOk "$SMPrograms\MyProg\MyProg.lnk" 

Mit diesen Worten versuchte ich die folgenden Lösungen.

  • Ich habe die hier vorgestellte Lösung ausprobiert, die scheinbar keine Wirkung hatte.
  • Ich habe versucht, ein paar der Lösungen hier auch. Die Lösung von EthanAD hat auch nichts für mich getan. Das Laufen assoc .exe=exefilefunktionierte jedoch für mich auf einem PC (dem, auf dem ich die Installation testete). Es funktionierte jedoch nicht auf dem Computer, auf dem das NSIS-Skript und auf dem meine Entwicklungsumgebung ausgeführt wurde. Bei dem Versuch, das Problem zu beheben, glaube ich, dass ich Notepad als Standardprogramm für das Öffnen von .exeDateien in meiner Hast ausgewählt habe, um das Problem zu lösen. Jetzt wird jedes Programm mit Notepad geöffnet (ich habe sogar Notepad selbst mit Notepad geöffnet). Laufen assoc .exe=exeauf diesem PC hat keine Wirkung, obwohl läuft assoc .exeund ftype exefiledie richtigen Ergebnisse zurück ( .exe=exefileund exefile="%1" %*jeweils).

Kann mir jemand helfen, die Windows-Standardfunktionen in Bezug auf EXE-Dateien wiederherzustellen?

--- BEARBEITEN ---

Um zu klären, dies ist kein Duplikat dieser Frage, ich habe es (als Administrator) ausprobiert und es hat nichts getan.

0
@Ramhound Ich habe das schon gemacht. Ich habe tatsächlich die Schritte, die ich aus dieser Frage ausprobiert habe. Ich habe jedoch auf die Microsoft-Site verlinkt, damit die von mir ausgeführten Schritte nicht mit anderen Antworten verwechselt wurden. audiFanatic vor 6 Jahren 0
Ja bitte. Ich habe jedes Mal neu gestartet, wenn ich einen Fix versucht habe audiFanatic vor 6 Jahren 0
@Ramhound Sie sind keine Widersprüche, denn das erste Paar "Duplikate", für das Sie mich gekennzeichnet haben, war tatsächlich keine Duplikate. Sie haben nur nach Brownie-Punkten mit den Mods gesucht, Sie wollten nicht helfen. Wenn Sie helfen wollten, hätten Sie mit einer Antwort zu tun gehabt, ich hätte gesagt "Ja, das hat funktioniert" oder "Nein, das hat nicht funktioniert", und dann hätten Sie mich im ersten Fall als Duplikat markiert . Dies ist ein Forum für konstruktive Diskussionen, dies ist keine konstruktive Diskussion, das ist Brownie-Punktjagd. audiFanatic vor 6 Jahren 0
I didn’t read external sources. I knew what the solution was. Turns out I was right. Enjoy your day[.](https://superuser.com/questions/920156/accidentally-associated-exe-files-with-java-exe?noredirect=1&lq=1) you lost no reputation with this question by the way. Ramhound vor 6 Jahren 0
Many ways to skin the cat, sometimes you have to try more then one knife, because the first knife didn’t skin the cat completely doesn’t mean I didn’t know what had to be accomplished. I have referred to that registry file about a hundred times over the last 6 years in comments I have made. It’s “alll of the above type solution” Ramhound vor 6 Jahren 0
Sehr gut, aber noch einmal kennzeichnen Sie es als Duplikat, bis es tatsächlich ein Duplikat ist. Sie bringen niemanden vor verschiedenen fiktiven Anschuldigungen vor Gericht, bis einer festhält. So funktioniert das Justizsystem in keinem zivilisierten Land und auch in den meisten unzivilisierten Ländern. Warum sollte es im Internet so funktionieren? audiFanatic vor 6 Jahren 0
Als erstes habe ich es als Duplikat markiert. Es wäre nicht als Duplikat geschlossen worden, bis vier andere Personen mit mir oder ein Moderator (oder ein Gold-Badge-Benutzer) mit mir einverstanden waren. Ramhound vor 6 Jahren 0

0 Antworten auf die Frage