Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-06-2020, 05:33
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,217
Thanks: 294
Thanked 1,405 Times in 637 Posts
Masquerade is on a distinguished road
Unknown Type: PChar

Hello all, I have been adding the module ITDownload to my installer script, so redist files can be downloaded instead of me having to bundle them into the installer.

I currently have everything integrated, here is an example:

Code:
procedure InstallRedists;
  begin
  itd_init;
  #ifdef directx
  itd_addfile('https://download.microsoft.com/download/1/7/1/1718CCC4-6315-4D8E-9543-8E28A4E18C4C/dxwebsetup.exe',expandconstant('{app}\_Redist\dxwebsetup.exe'));
  #endif

  itd_downloadafter(wpInstalling);

  #ifdef directx
  Exec2(ExpandConstant('{app}\_Redist\dxwebsetup.exe'),'',true);
  #endif 
end;
At the start of the script,
Code:
#define directx
exists so this code does apply.

I integrated into the script the iss file and module:

Code:
#include "Resources\Modules\itd\it_download.iss"
However now when compiling, this error appears:



Does anyone know what this error could mean? The error lies in the iss script for the ITDownlaod module and not in my installer script.

I am using Inno Setup Unicode 6.0.3
Reply With Quote
Sponsored Links
  #2  
Old 02-06-2020, 06:15
pincoball pincoball is offline
Registered User
 
Join Date: Mar 2020
Location: Italy
Posts: 29
Thanks: 20
Thanked 10 Times in 8 Posts
pincoball is on a distinguished road
Seems like the variable type PChar is not anymore compatible with Inno Setup 6.
https://jrsoftware.org/ishelp/index.php?topic=unicode

Quoting:
Quote:
Its 'PChar' type has been renamed to 'PAnsiChar'
and

Quote:
If you want to compile an existing script that imports ANSI Windows API calls with the Unicode compiler, either upgrade to the 'W' Unicode API call or change the parameters from 'String' or 'PChar' to 'AnsiString'. The 'AnsiString' approach will make your [Code] compatible with both the Unicode and the non Unicode version.
Try replacing in the mentioned script from PChar to either PAnsiChar or AnsiString
Reply With Quote
The Following User Says Thank You to pincoball For This Useful Post:
Masquerade (02-06-2020)
  #3  
Old 02-06-2020, 07:07
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,217
Thanks: 294
Thanked 1,405 Times in 637 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by pincoball View Post
Try replacing in the mentioned script from PChar to either PAnsiChar or AnsiString
Compiling works, brilliant!

On testing though, things get a little nasty:



The progress bar is at 100% so the redist downloader process is began.

Installing/Uninstalling works without checking redist box so the script still functions. Only with redist selected will cause this.

Edit: the module is loaded, behind the buttons that the text for the module is there (the progress bar, eta etc..).

Last edited by Masquerade; 02-06-2020 at 07:10.
Reply With Quote
  #4  
Old 02-06-2020, 07:31
pincoball pincoball is offline
Registered User
 
Join Date: Mar 2020
Location: Italy
Posts: 29
Thanks: 20
Thanked 10 Times in 8 Posts
pincoball is on a distinguished road
I think that this module is pretty old and it might not support newer versions of Inno Setup thus the problem may arise from another incompatibility... but I think that something else can be done.
Have you tried translating the error message? I know that if you cannot copy and paste you should rely on OCR reading from the screenshot but I think you might give it a try if it says something relevant

Also, does it give the same problem with both PAnsiChar and AnsiString?
Reply With Quote
  #5  
Old 02-06-2020, 16:04
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by Masquerade View Post
Compiling works, brilliant!

On testing though, things get a little nasty:



The progress bar is at 100% so the redist downloader process is began.

Installing/Uninstalling works without checking redist box so the script still functions. Only with redist selected will cause this.

Edit: the module is loaded, behind the buttons that the text for the module is there (the progress bar, eta etc..).
Can you send me the code that is showing this image message?
I would like to analyze this.

Another way to make Unicode and Ansi compatible is to just include this before the functions that PChar uses.
Code:
#ifdef UNICODE
type
  PChar = PAnsiChar;
#endif
I found it much more interesting to download this module DwinsHs.
The FTP, HTTP and HTTPS protocols are supported.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
Masquerade (03-06-2020)
  #6  
Old 03-06-2020, 06:44
Masquerade Masquerade is offline
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 1,217
Thanks: 294
Thanked 1,405 Times in 637 Posts
Masquerade is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
I found it much more interesting to download this module DwinsHs.
The FTP, HTTP and HTTPS protocols are supported.
Thank you Cesar, I will try and implement this. Is there a way to add an extra page to the installer after installing for the redist downloading? I am using the ASIS script which already has an extra page for CRC checking.
Reply With Quote
  #7  
Old 03-06-2020, 07:07
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,689
Thanks: 1,106
Thanked 7,336 Times in 2,838 Posts
KaktoR is on a distinguished road
Quote:
Originally Posted by Masquerade View Post
Thank you Cesar, I will try and implement this. Is there a way to add an extra page to the installer after installing for the redist downloading? I am using the ASIS script which already has an extra page for CRC checking.
Sure. Just create a new page

Look on how the CRCPage was created. This should guide you in the right direction
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
Masquerade (03-06-2020)
  #8  
Old 19-06-2020, 09:07
bunti_o4u's Avatar
bunti_o4u bunti_o4u is offline
Registered User
 
Join Date: Aug 2017
Location: India
Posts: 162
Thanks: 29
Thanked 172 Times in 61 Posts
bunti_o4u is on a distinguished road
Loading items in combobox from text file

I am trying to load the items in a combobox from a text file but whats it loading is the last line and not all the lines..

Pl help. Thnx in advance..
Code:
var
  S: String;

function GetFileLines(const FileName: string; out Items: string): Boolean;
var
  FileLines: TArrayOfString;
  LineIndex: Integer;
begin
  Result:= LoadStringsFromFile(FileName, FileLines);
  if Result then
    for LineIndex:=0 to (GetArrayLength(FileLines)-1) do
    Items:= FileLines[LineIndex];
end;

  Combobox1:= TComboBox.Create(WizardForm);
  with Combobox1 do
  begin
    Parent:=WizardForm;
    SetBounds(left, Top, Width, Height);
    Style:=csDropDown;
    Color:=clWhite;
    if GetFileLines(ExpandConstant('{src}\Text.ini'), S) then
      Items.Add(S);
  end;

Last edited by bunti_o4u; 19-06-2020 at 09:12.
Reply With Quote
  #9  
Old 19-06-2020, 11:16
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by bunti_o4u View Post
I am trying to load the items in a combobox from a text file but whats it loading is the last line and not all the lines..

Pl help. Thnx in advance..
Code:
var
  S: String;

function GetFileLines(const FileName: string; out Items: string): Boolean;
var
  FileLines: TArrayOfString;
  LineIndex: Integer;
begin
  Result:= LoadStringsFromFile(FileName, FileLines);
  if Result then
    for LineIndex:=0 to (GetArrayLength(FileLines)-1) do
    Items:= FileLines[LineIndex];
end;

  Combobox1:= TComboBox.Create(WizardForm);
  with Combobox1 do
  begin
    Parent:=WizardForm;
    SetBounds(left, Top, Width, Height);
    Style:=csDropDown;
    Color:=clWhite;
    if GetFileLines(ExpandConstant('{src}\Text.ini'), S) then
      Items.Add(S);
  end;
TRY:
Code:
procedure GetFileLines(const FileName: string; var Combo: TComboBox);
var
  FileLines: TArrayOfString;
  LineIndex: Integer;
begin
  if  LoadStringsFromFile(FileName, FileLines) then
    for LineIndex := 0 to GetArrayLength(FileLines) - 1 do
      Combo.Items.Add(FileLines[LineIndex]);
end;

  Combobox1:= TComboBox.Create(WizardForm);
  with Combobox1 do
  begin
    Parent := WizardForm;
    SetBounds(left, Top, Width, Height);
    Style := csDropDown;
    Color := clWhite;
    GetFileLines(ExpandConstant('{src}\Text.ini'), Combobox1)
  end;
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
bunti_o4u (19-06-2020)
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup REV0 Conversion Tutorials 129 21-05-2021 05:51
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 08:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com