2011-12-13 15 views
5

Stworzyłem prostą aplikację WinForm i niestandardowy instalator. Wszystko wydaje się dość proste, ale w dzienniku zdarzeń pojawiają się następujące wyskakujące okienka i szczegóły błędu.Błąd 1001 przy użyciu niestandardowego instalatora z Visual Studio 2008

Error message box displayed before running the custom action code

The description for Event ID 11001 from source MsiInstaller cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event:

Product: Custom Action Tester -- Error 1001. Error 1001. Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\system32\Action' or one of its dependencies. The system cannot find the file specified.. (NULL) (NULL) (NULL) (NULL) (NULL)

the message resource is present but the message is not found in the string/message table

Sprawdziłem C: \ Windows \ system32 i nie ma plik lub folder o nazwie Akcja ale są 3 pliki zwane ActionCenter.dll, ActionCenterCPL.dll i ActionQueue .dll

Jakieś pomysły na rozwiązanie tego błędu?

EDIT:

Po sugestię cosmin-pirvu Pobiegłem instalatorowi logowania. Obszar, w którym pojawia się błąd, jest pokazany poniżej, ale nadal nie jestem mądrzejszy, jak rozwiązać ten problem.

MSI (s) (40:7C) [09:34:26:523]: Executing op: CustomActionSchedule(Action=_FBC0CC84_D5B4_41F9_A3EC_98A13BC7E73E.install,ActionType=3073,Source=BinaryData,Target=ManagedInstall,CustomActionData=/installtype=notransaction /action=install /LogFile= /targetdir="C:\Test\Custom Action Tester\" /Param1="C:\Test\TestFile.txt" /Param2="C:\Test\" "C:\Test\Custom Action Tester\ConfigSetup.dll" "C:\Users\wildb\AppData\Local\Temp\CFG66BE.tmp") 
MSI (s) (40:94) [09:34:26:525]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI85A8.tmp, Entrypoint: ManagedInstall 
MSI (s) (40:F0) [09:34:26:525]: Generating random cookie. 
MSI (s) (40:F0) [09:34:26:557]: Created Custom Action Server with PID 6492 (0x195C). 
MSI (s) (40:D4) [09:34:26:586]: Running as a service. 
MSI (s) (40:D4) [09:34:26:587]: Hello, I'm your 32bit Elevated custom action server. 
DEBUG: Error 2835: The control ErrorIcon was not found on dialog ErrorDialog 
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog, 
Error 1001. Error 1001. Exception occurred while initializing the installation: 
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Windows\system32\Action' or one of its dependencies. The system cannot find the file specified.. 
MSI (s) (40!4C) [09:34:29:580]: 
MSI (s) (40:94) [09:34:29:584]: Leaked MSIHANDLE (14) of type 790531 for thread 7244 
MSI (s) (40:94) [09:34:29:584]: Note: 1: 2769 2: _FBC0CC84_D5B4_41F9_A3EC_98A13BC7E73E.install 3: 1 
DEBUG: Error 2769: Custom Action _FBC0CC84_D5B4_41F9_A3EC_98A13BC7E73E.install did not close 1 MSIHANDLEs. 
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2769. The arguments are: _FBC0CC84_D5B4_41F9_A3EC_98A13BC7E73E.install, 1, 
CustomAction _FBC0CC84_D5B4_41F9_A3EC_98A13BC7E73E.install returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) 
Action ended 09:34:29: InstallExecute. Return value 3. 

To miała być szybka wygrana, aby życie stało się prostsze dla naszych użytkowników; nie chcieli edytować plików konfiguracyjnych ... ale zmieniło się to w koszmar. : O (

EDIT 2:

Po dużo zabawy, błąd prezentuje tylko się gdy parametry są określone w akcji niestandardowej, jak pokazano na rysunku Problem polega na tym, zwyczaj instalator. bezużyteczny, nie będąc w stanie odczytać wartości wpisane w poprzednich zainstalować ekrany.

Custom action property screen

+1

Spróbuj utworzyć szczegółowy dziennik instalacji, aby sprawdzić przyczynę błędu: http://setupanddeployment.com/debugging/msi-log. Możesz wyszukać "Return Value 3" w logu. –

Odpowiedz

6

Po wielu godzin w kółko i w końcu okazało się, że problem i co ważniejsze, rozwiązania.

Powinno być możliwe przekazać parametry jak „CustomActionData” zgodnie z definicją on this blog ale parametry są nieco querky co najmniej ...

znalazłem, że parametry tekstowe nie mogą mieć cudzysłowy wokół parametru imię i powinny być sformatowane tak:

/Param1=[CONFIG_TESTFILE] /Param2=[CONFIG_TESTFOLDER]

Ponadto, aby użyć parametru katalogu docelowego trzeba zawierać cytaty, ale zamiast kończące się pole z tylnym ukośnikiem, należy używać spacji, zamiast, jak to :

/target="[TARGETDIR] "

+3

Proponuję użyć "\" zamiast spacji dla celu. Możesz łatwo użyć tego kodu, aby uzyskać poprawną ścieżkę: string exePath = Path.Combine (Context.Parameters ["targetdir"], "TestForSetup.exe"); var config = ConfigurationManager.OpenExeConfiguration (exePath); –

+1

Dzięki, to naprawdę mnie zaskoczyło. A ostatnia część jest naprawdę bardzo dziwna. – Jens

+0

@Stef Nawet z końcowym "\", musisz dodać dodatkowe miejsce, aby instalator działał poprawnie. (Bez spacji mój instalator pomyślnie zainstaluje moje oprogramowanie, ale nieudana instalacja nie wyświetla powyższego komunikatu.) Wygląda na to, że instalator traktuje zakończenie "\" jako znak ucieczki dla końcowego podwójnego cudzysłowu ("), więc musisz wstawić spację między. –

Powiązane problemy