AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

[InnoSetup] Benutzername eingeben

Ein Thema von MarkusL. · begonnen am 22. Mai 2018 · letzter Beitrag vom 30. Mai 2018
Antwort Antwort
MarkusL.

Registriert seit: 7. Okt 2017
18 Beiträge
 
#1

[InnoSetup] Benutzername eingeben

  Alt 22. Mai 2018, 20:45
Guten Abend,
ich habe eine Benutzername Eingabe während der Installation, ich möchte aber gerne das man erst weiter klicken kann, wenn auch ein Name eingegeben wurde. Das heißt, dass anstatt den Text "Benutzername eingeben..." der schon in der Leiste steht oder wenn man die Leiste leer lässt es nicht weiter gehen kann. Ist sowas möglich?

Mfg
  Mit Zitat antworten Zitat
Benutzerbild von timog
timog

Registriert seit: 26. Sep 2006
Ort: Landkreis Oldenburg (Oldb)
117 Beiträge
 
Delphi 10.2 Tokyo Enterprise
 
#2

AW: [InnoSetup] Benutzername eingeben

  Alt 22. Mai 2018, 22:12
Schau Dir mal das Beispiel Skript CodeDlg.iss von Inno an. Dort solltest Du alles mit Kommentaren erklärt finden.
Timo
Real Programmers are surprised when the odometers in their cars don't turn from 99999 to 9999A.
  Mit Zitat antworten Zitat
MarkusL.

Registriert seit: 7. Okt 2017
18 Beiträge
 
#3

AW: [InnoSetup] Benutzername eingeben

  Alt 24. Mai 2018, 12:39
Schau Dir mal das Beispiel Skript CodeDlg.iss von Inno an. Dort solltest Du alles mit Kommentaren erklärt finden.
Dankeschön! Ich wollte mir diese Funktion rausnehmen, weil es dort noch weitere gibt aber irgendwie scheint es nicht zu funktionieren. Nur die Funktion mit dem Benutzernamen (Das ein Namen eingetragen werden muss) kriege ich nicht da raus.
  Mit Zitat antworten Zitat
Benutzerbild von TigerLilly
TigerLilly

Registriert seit: 24. Mai 2017
Ort: Wien, Österreich
1.241 Beiträge
 
Delphi 12 Athens
 
#4

AW: [InnoSetup] Benutzername eingeben

  Alt 24. Mai 2018, 20:02
Lies dir mal in der Hilfe zu Inno alles über den Abschnitt [Code] durch + wann die Funktionen dort aufgerufen werden.

Oder poste dein Script hier.
  Mit Zitat antworten Zitat
Benutzerbild von KodeZwerg
KodeZwerg

Registriert seit: 1. Feb 2018
3.691 Beiträge
 
Delphi 11 Alexandria
 
#5

AW: [InnoSetup] Benutzername eingeben

  Alt 24. Mai 2018, 20:37
In diesem Beispiel ging es darum das nur Nummern plus Next-Knopf erst wenn mindestens ein Zeichen da steht.
Zitat:
You can setup the next button to be enabled or disabled in the CurPageChanged event when the user reaches the page where resides your edit box. Except that you need to monitor changes of that edit box to enable or disable the next button according to whether there's something entered in that edit box. For this you need to write a handler for the OnChange event. Here is an example:
Delphi-Quellcode:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
var
  MyEdit: TNewEdit;
  MyPage: TWizardPage;

procedure MyEditChange(Sender: TObject);
begin
  // enable the next button if the edit box is not empty; disable otherwise
  WizardForm.NextButton.Enabled := MyEdit.Text <> '';
end;

procedure MyEditKeyPress(Sender: TObject; var Key: Char);
var
  KeyCode: Integer;
begin
  // allow only numbers
  KeyCode := Ord(Key);
  if not ((KeyCode = 8) or ((KeyCode >= 48) and (KeyCode <= 57))) then
    Key := #0;
end;

procedure InitializeWizard;
begin
  MyPage := CreateCustomPage(wpWelcome, 'Caption', 'Description');

  MyEdit := TNewEdit.Create(WizardForm);
  MyEdit.Parent := MyPage.Surface;
  MyEdit.Left := 0;
  MyEdit.Top := 0;
  MyEdit.Width := 150;
  MyEdit.OnChange := @MyEditChange;
  MyEdit.OnKeyPress := @MyEditKeyPress;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  // if the currently turned wizard page is the one with the edit box, enable
  // the next button if the edit box is not empty; disable otherwise
  if CurPageID = MyPage.ID then
    WizardForm.NextButton.Enabled := MyEdit.Text <> '';
end;
Gruß vom KodeZwerg
  Mit Zitat antworten Zitat
MarkusL.

Registriert seit: 7. Okt 2017
18 Beiträge
 
#6

AW: [InnoSetup] Benutzername eingeben

  Alt 25. Mai 2018, 19:46
In diesem Beispiel ging es darum das nur Nummern plus Next-Knopf erst wenn mindestens ein Zeichen da steht.
Zitat:
You can setup the next button to be enabled or disabled in the CurPageChanged event when the user reaches the page where resides your edit box. Except that you need to monitor changes of that edit box to enable or disable the next button according to whether there's something entered in that edit box. For this you need to write a handler for the OnChange event. Here is an example:
Delphi-Quellcode:
[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Code]
var
  MyEdit: TNewEdit;
  MyPage: TWizardPage;

procedure MyEditChange(Sender: TObject);
begin
  // enable the next button if the edit box is not empty; disable otherwise
  WizardForm.NextButton.Enabled := MyEdit.Text <> '';
end;

procedure MyEditKeyPress(Sender: TObject; var Key: Char);
var
  KeyCode: Integer;
begin
  // allow only numbers
  KeyCode := Ord(Key);
  if not ((KeyCode = 8) or ((KeyCode >= 48) and (KeyCode <= 57))) then
    Key := #0;
end;

procedure InitializeWizard;
begin
  MyPage := CreateCustomPage(wpWelcome, 'Caption', 'Description');

  MyEdit := TNewEdit.Create(WizardForm);
  MyEdit.Parent := MyPage.Surface;
  MyEdit.Left := 0;
  MyEdit.Top := 0;
  MyEdit.Width := 150;
  MyEdit.OnChange := @MyEditChange;
  MyEdit.OnKeyPress := @MyEditKeyPress;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  // if the currently turned wizard page is the one with the edit box, enable
  // the next button if the edit box is not empty; disable otherwise
  if CurPageID = MyPage.ID then
    WizardForm.NextButton.Enabled := MyEdit.Text <> '';
end;
Das funktioniert! Nur ich benutze zusätzlich "Graphical Installer Wizard for Inno Setup" und damit zusammen funktioniert es leider nicht mehr. Ich kann so viele Zahlen eingeben wie ich möchte, der Next Buttom wird nicht aktiv.
  Mit Zitat antworten Zitat
Antwort Antwort

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz