Je nach Dateiort, diese ausführen

Post Reply
impag
Posts: 18
Joined: 05. May 2006, 15:25
Location: Zürich
Contact:

Je nach Dateiort, diese ausführen

Post by impag » 27. Feb 2014, 12:45

Ich habe ein Programm an zwei Orten (C:\Norman oder C:\program files\Norman) installiert, je nach PC Revision.
Ich möchte diese Datei nur ausführen, wenn Sie auch auf dem System vorliegt.
Findet Empirum keine dieser beiden Dateien, dann soll auch keine ausgeführt werden.

Was mache ich falsch?

Code: Select all

[Product]
;#FileCheckMachine, MACHINE
;#FileCheckClient, CLIENT
;ReplaceEnv <Variable>

#Set:Product
#Set:Installation, DONTDELETE
;#Set:N1, DONTDELETE (auskommentieren oder nicht?)
;#Set:N2, DONTDELETE (auskommentieren oder nicht?)
#Set:Deinstallation, DELETE
#Reg:OnUninstallProduct, DELETE
#Reg:Product
#Ini:Product
#Security:Product

[Set:Product]

[SET:Installation]
AddMeter -1

If DoesFileExist ("c:\program Files\Norman\Npm\Bin\delnvc5.exe") == "1" Then "SET:N1" EndIf
If DoesFileExist ("c:\Norman\Npm\Bin\delnvc5.exe") == "1" Then "SET:N2" EndIf

[SET:N1]
call "c:\program Files\Norman\Npm\Bin\delnvc5.exe" /quiet
If %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf

[SET:N2]
call "c:\Norman\Npm\Bin\delnvc5.exe" /quiet
If %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf

[SET:Deinstallation]
If "%Src%\" <> "" Then "SET:Deinstallation2" EndIf

[SET:Deinstallation2]
If %ErrorLevel% <> "0" Then "SET:DeInstallationError" EndIf
-Call "%Src%\" 
-AddMeter -1

impag
Posts: 18
Joined: 05. May 2006, 15:25
Location: Zürich
Contact:

Re: Je nach Dateiort, diese ausführen

Post by impag » 04. Mar 2014, 10:18

So, ja es funktioniert so einwandfrei :D

Was mir noch fehlt ist die ganze ELSE Schlaufe. Sprich wenn diese Datei nicht da ist und die andere auch nicht, dann mache etwas. Aber nur dann...

Hier noch der Code für die Messagebox:

Code: Select all

[SET:N1]
Set Text1=Norman found in c:\Programme\Norman\Npm\Bin
SplashDialogOn 15%, 40%, 70%, 12%
SplashDialogText "%text1%", Arial, 12, , 000000, 4, 10, CENTER BOLD
sleep 5000
SplashDialogOff

seipf
Posts: 101
Joined: 13. Sep 2013, 12:00
Contact:

Re: Je nach Dateiort, diese ausführen

Post by seipf » 04. Mar 2014, 10:40

Hi,

das müsste doch eigentlich funktionieren, wenn du es direkt nach den beiden IF-Abfragen im Abschnitt "SET:Installation" einfügst.
impag wrote: [SET:Installation]
AddMeter -1

If DoesFileExist ("c:\program Files\Norman\Npm\Bin\delnvc5.exe") == "1" Then "SET:N1" EndIf
If DoesFileExist ("c:\Norman\Npm\Bin\delnvc5.exe") == "1" Then "SET:N2" EndIf
Viele Grüße
Florian

Marcus_B
Posts: 126
Joined: 15. Jul 2008, 13:02
Location: Berlin
Contact:

Re: Je nach Dateiort, diese ausführen

Post by Marcus_B » 07. Mar 2014, 14:14

Hallo,

Du könntest das auch per Variable abfackeln.

Code: Select all

[Set:Installation]
Set ISTDA=0

If DoesFileExist ("c:\program Files\Norman\Npm\Bin\delnvc5.exe") == "1" Then "SET:N1" EndIf
If DoesFileExist ("c:\Norman\Npm\Bin\delnvc5.exe") == "1" Then "SET:N2" EndIf

If %ISTDA% == "0" then "SET:KEINEDATEI" EndIf 

[SET:N1] bzw [SET:N2]
SET ISTDA=1
Gruß
Marcus

Post Reply

Return to “Paketierung”

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests