Page 1 of 1

Je nach Dateiort, diese ausführen

Posted: 27. Feb 2014, 12:45
by impag
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

Re: Je nach Dateiort, diese ausführen

Posted: 04. Mar 2014, 10:18
by impag
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

Re: Je nach Dateiort, diese ausführen

Posted: 04. Mar 2014, 10:40
by seipf
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

Re: Je nach Dateiort, diese ausführen

Posted: 07. Mar 2014, 14:14
by Marcus_B
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