Autor Beitrag
bennySB
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Di 14.05.13 23:01 
Guten Abend alle zusammen,

ich habe mir mal für ein Setup folgende Datei geschrieben, noch ist sie nicht vollends fertig, ein paar Dinge werden noch dazu kommen, welche aber nichts mit der momentanen Sache am Hut haben.

Einmal der komplette Code:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "DOSBox CAE2000 Version"
#define MyAppVersion "1.0"
#define MyAppPublisher "xxx"
#define MyAppURL "xxx"
#define MyAppExeName "DOSBoxPrinter.exe"


[Setup]
; NOTE: The value of AppId uniquely identifies this application.
Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId=DOSBox CAE2000 Version
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL=xxx
AppSupportURL=xxx
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\DOSBox_CAE2000
DefaultGroupName=DOSBox-CAE2000
OutputBaseFilename=DOSBox_CAE2000 Version
UseSetupLdr=yes
SetupIconFile=D:\WISAG\Logos\WISAG_Logo.ico
Compression=none
//lzma2/ultra
SolidCompression=yes
InternalCompressLevel=ultra
AppCopyright= © 2013 - {#MyAppPublisher}
WindowVisible=true
UsePreviousAppDir=yes
UsePreviousGroup=yes
UsePreviousSetupType=yes
UsePreviousTasks=yes
UsePreviousUserInfo=yes
DirExistsWarning=AUTO
ChangesAssociations=yes
SetupLogging=yes
AlwaysUsePersonalGroup=yes
BackSolid=yes
BackColor=clGray
BackColor2=clLime


[Languages]
Name: "german"; MessagesFile: "compiler:Languages\German.isl"

[CustomMessages]
      FilesDataLocation=Wählen Sie das Verzeichnis von CAE2000 aus
      FilesDataHeader=Wo soll die Datei "Druckerparameter" gespeichert Werden?
      FilesDataDescription=Die Datei "Druckerparameter" wird im folgenden Ordner gespeichert
      SelectDirBrowseLabel=Klicken Sie auf "Weiter", um fortzufahren. \
      Klicken Sie auf "Durchsuchen", falls Sie einen anderen Ordner auswählen möchten.
      NewFolder=Neuer Ordner


[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "{code:InstallCae}\PRTDEF.GER"; DestDir: "{code:InstallCae}\Backup\"; Flags: external ignoreversion
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBoxPrinter.sfx\DOSBoxPrinter.exe"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBoxPrinter.sfx\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\zmbv\*"; DestDir: "{app}\zmbv"; Flags: ignoreversion recursesubdirs createallsubdirs uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\doc\*"; DestDir: "{app}\doc\"; Flags: ignoreversion recursesubdirs createallsubdirs uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\COPYING.txt"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\dosbox.exe"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\INSTALL.txt"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\msvcp71.dll"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\msvcr71.dll"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\NEWS.txt"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\SDL.dll"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\SDL_net.dll"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\zmbv\THANKS.txt"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\courier.ttf"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\dosbox-debug.exe"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\fontlicense.txt"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\pdcurses.dll"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\roman.ttf"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\sansserif.ttf"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\DOSBox_Megabuild6-win32-installer\script.ttf"; DestDir: "{app}"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\dosbox-SVN_MB6.conf"; DestDir: "{localappdata}\DOSBox\"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\german-0.74.lang"; DestDir: "{localappdata}\DOSBox\"; Flags: ignoreversion uninsrestartdelete
Source: "C:\Users\BWolonkieiwicz\Desktop\PRTDEF.GER"; DestDir: "{code:InstallCae}"; Flags: ignoreversion uninsneveruninstall
//{localappdata}\DOSBox\dosbox-SVN_MB6.conf
; NOTE: Don't use "Flags: ignoreversion" on any shared system files


[Icons]
Name: "{group}\DOSBox CAE2000 Version"; Filename: "{app}\DOSBoxPrinter.exe"; IconFilename: "{app}\dosbox.exe"
Name: "{group}\Lies Mich"; Filename: "{app}\README.txt"; IconFilename: "{app}\install.txt"
Name: "{group}\Konfigurationsdatei"; Filename: "{localappdata}\DOSBox\dosbox-SVN_MB6.conf"; IconFilename: "{app}\dosbox.exe"
Name: "{group}\Deinstalieren"; Filename: "{app}\unins000.exe"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\unins000.exe"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon; IconFilename: "{app}\dosbox.exe"

[Code]

  var
    UserDirPage : TInputDirWizardPage;
    UserFolder : string;
    
    function InitializeSetup: boolean;
      
      begin
        UserFolder := '
';
        Result := true;
      end;

    function InstallCae(Param:String):String;
      
      begin
        result := UserDirPage.Values[0] ;
      end;
 
    procedure InitializeWizard;
    
      begin
      UserDirPage := CreateInputDirPage(wpSelectDir,
      ExpandConstant('
{cm:FilesDataLocation}'),
      ExpandConstant('
{cm:FilesDataHeader}'),
      ExpandConstant('
{cm:FilesDataDescription}'),
      false,
      '
Neuer Ordner');

      //"Klicken sie weiter..." Meldung
      UserDirPage.Add(SetupMessage(msgSelectDirBrowseLabel));

      //Standardpfad in der Verzeichnisauswahl
      UserDirPage.Values[0] := ExpandConstant(
      '
C:\CAE2000\');
      end;

    procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);   //Code für deinstallation
      
      begin
        if CurUninstallStep=usPostUninstall then
          
          begin
            FileCopy(ExpandConstant('
{code:InstallCae}\Backup\PRTDEF.GER'),ExpandConstant('{code:InstallCae}\PRTDEF.GER'),true);
            DelTree(ExpandConstant('
{code:InstallCae}\Backup\'), true, true, true);
          end; 
      
      end;
     

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '
&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: files; Name: "{app}\*.exe"
Type: files; Name: "{app}\*.dll"
Type: files; Name: "{app}\*.txt"
Type: files; Name: "{app}\*.ttf"
Type: files; Name: "{app}\doc\*.html"
Type: files; Name: "{app}\doc\images\*.png"
Type: files; Name: "{app}\zmbv\*.txt"
Type: files; Name: "{app}\zmbv\*.dll"
Type: files; Name: "{app}\zmbv\*.inf"
Type: files; Name: "{app}\PrintApps\*.exe"
Type: files; Name: "{app}\PrintApps\PDFV\*.exe"
Type: files; Name: "{app}\PrintApps\PDFV\*.pdf"
Type: files; Name: "{app}\PrintApps\PDFV\*.dat"
Type: files; Name: "{app}\PrintOut\*.btm"
Type: files; Name: "{localappdata}\DOSBox\"


Mein Problem besteht nun darin das ich beim Ausführen der Deinstallation die Fehlermeldung "Could not call proc" bekomme und mein ersteller Backup-ordner zwar gelöscht wird, jedoch die Backup-Datei nicht kopiert wird.

Anbei zur Veranschaulichung der Code

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
    procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);   //Code für deinstallation
      
      begin
        if CurUninstallStep=usPostUninstall then
          
          begin
            FileCopy(ExpandConstant('{code:InstallCae}\Backup\PRTDEF.GER'),ExpandConstant('{code:InstallCae}\PRTDEF.GER'),true);
            DelTree(ExpandConstant('{code:InstallCae}\Backup\'), true, true, true);
          end
      
      end;


Ich hoffe jemand hat einen Tipp für mich Neuling.

MfG Benny


Moderiert von user profile iconNarses: Topic aus Dateizugriff verschoben am Mi 15.05.2013 um 12:25
bennySB Threadstarter
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Mi 15.05.13 09:25 
Edit:
Meine Vermutung liegt darin das es an dieser Zeile liegt, denn wenn ich sie ausklammere kriege ich keine Fehlermeldung.
Aber was kann daran falsch sein?

ausblenden Delphi-Quelltext
1:
2:
[Files]
Source: "{code:InstallCae}\PRTDEF.GER"; DestDir: "{code:InstallCae}\Backup\"; Flags: external ignoreversion
bennySB Threadstarter
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Do 16.05.13 20:55 
Niemand da der irgendwas dazu sagen könnte?
bennySB Threadstarter
Hält's aus hier
Beiträge: 10



BeitragVerfasst: Do 23.05.13 12:47 
Hat sich erledigt, bin auch ohne Hilfe auf den Fehler gekommen.

Der Code sieht nun so aus

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
      begin
        if CurUninstallStep=usPostUninstall then

            FileCopy('{code:InstallCae}\Backup\PRTDEF.GER','{code:InstallCae}\PRTDEF.GER',false);
            DelTree('{code:InstallCae}\Backup\*', true, true, true);

      end;