FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   INNO TROUBLESHOOT - Questions Here (https://fileforums.com/showthread.php?t=93193)

Cesar82 24-04-2020 16:21

Quote:

Originally Posted by KaktoR (Post 485450)
So, how to delete the shortcuts after uninstall?

IS help tells me to do this through [UninstallDelete], but how?

You can do it through [UninstallDelete].
But as the shortcut was created on installation in the code, you can remove this shortcut using the code in the:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);

Code:

if IniKeyNotEmpty('Executable', 'Exe') then
begin
  DeleteFile(ExpandConstant('{commonstartmenu}\' + GetIniString('Executable', 'ExeName', '', ExpandConstant('{tmp}\Settings.ini')) + '.lnk'));
end;

In this way, the Settings.ini file must be copied to the installation folder during installation and when uninstalling it must be copied to the temp folder at:
function InitializeUninstall (): Boolean;

KaktoR 24-04-2020 16:26

I did it this way too, but doesn't work.

My old code
Code:

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
case of usPostUninstall
begin
DeleteFile(ExpandConstant('{userdesktop}\' + GetIniString('Executable', 'Shortcut1Name', '', ExpandConstant('{tmp}\Settings.ini')) + '.lnk'));
DeleteFile(ExpandConstant('{userstartmenu}\' + GetIniString('Executable', 'Shortcut1Name', '', ExpandConstant('{tmp}\Settings.ini')) + '.lnk'));
end;

Maybe I should have test this with ForceDirectories function?

Edit:
Quote:

Originally Posted by Cesar82 (Post 485461)
In this way, the Settings.ini file must be copied to the installation folder during installation and when uninstalling it must be copied to the temp folder at:
function InitializeUninstall (): Boolean;

Ok, that explains alot. Unfortunatelly not an option for me.

Cesar82 24-04-2020 17:12

1 Attachment(s)
Code:

[UninstallDelete]
#define i 0
#sub RemoveShortcut
  #emit "Type: Files; Name: ""{userdesktop}" + Trim(ReadIni(SourcePath + "\Settings.ini", "Executable" + Str(i), "ExeName", "")) + ".lnk"";"
  #emit "Type: Files; Name: ""{userprograms}" + Trim(ReadIni(SourcePath + "\Settings.ini", "Settings", "Name", "")) + "" + Trim(ReadIni(SourcePath + "\Settings.ini", "Executable" + Str(i), "ExeName", "")) + ".lnk"";"
#endsub
#for {i = 1; Trim(ReadIni(SourcePath + "\Settings.ini", "Executable" + Str(i), "ExeName", "")) != ""; i++} RemoveShortcut

I attached another example using ISPP and the icons section.
Using ISPP it is not possible to change the name of the shortcuts by changing any external ini after compiling the script

KaktoR 27-04-2020 11:50

Thanks Cesar.

But there seems to be a problem with this ispp code.

I have this

Code:

[Executable1]
ShortcutName=Application
ExePath=bin\Application.exe
ExeParam=-Testparameter

Path is always "C:\bin" (I use {sd}\Games constant as default) and my test archive is like this: Archive.arc\bin\application.exe

The shortcut on desktop and startmenu is always C:\bin\application.exe.
I would like it read from INI: DefaultInstallDir={sd}\Games\{#Name}

Cesar82 27-04-2020 16:31

1 Attachment(s)
Quote:

Originally Posted by KaktoR (Post 485492)
Thanks Cesar.

But there seems to be a problem with this ispp code.

I have this

Code:

[Executable1]
ShortcutName=Application
ExePath=bin\Application.exe
ExeParam=-Testparameter

Path is always "C:\bin" (I use {sd}\Games constant as default) and my test archive is like this: Archive.arc\bin\application.exe

The shortcut on desktop and startmenu is always C:\bin\application.exe.
I would like it read from INI: DefaultInstallDir={sd}\Games\{#Name}

Try as in the attachment...
@KaktoR, I changed the attachment.
If you don't want to use tasks for the desktop shortcut, simply remove the [Tasks] section and also + "Tasks: desktopicon;" the shortcut line.
If you do not want to use a URL, simply do not include the lines referring to the URL shortcut.

KaktoR 28-04-2020 05:26

Thanks, this works fine.

I just don't understand all of this ispp things... Will read about it some more.

Cesar82 28-04-2020 05:55

Quote:

Originally Posted by KaktoR (Post 485498)
Thanks, this works fine.

I just don't understand all of this ispp things... Will read about it some more.

The ISPP performs procedures (ISPP Procedures) before compiling the script by changing the script text.

In the example in the above file you are saving a preprocessed script.
This file is used to visualize how the preprocessed code will look.

If using ISPP it is not possible to use an external Settings.ini with settings for shortcuts.
Using ISPP the settings.ini settings are "copied" to script.iss when compiling and cannot be changed afterwards.

doofoo24 25-05-2020 10:54

does the new inno 6.0.5 have Dark theme built-in ?

Masquerade 02-06-2020 05:33

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:

https://i.imgur.com/Ea67Y36.png

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

pincoball 02-06-2020 06:15

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

Masquerade 02-06-2020 07:07

Quote:

Originally Posted by pincoball (Post 486151)
Try replacing in the mentioned script from PChar to either PAnsiChar or AnsiString

Compiling works, brilliant!

On testing though, things get a little nasty:

https://i.imgur.com/4wUj20w.png

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..).

pincoball 02-06-2020 07:31

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?

Cesar82 02-06-2020 16:04

Quote:

Originally Posted by Masquerade (Post 486153)
Compiling works, brilliant!

On testing though, things get a little nasty:

https://i.imgur.com/4wUj20w.png

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.

Masquerade 03-06-2020 06:44

Quote:

Originally Posted by Cesar82 (Post 486159)
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.

KaktoR 03-06-2020 07:07

Quote:

Originally Posted by Masquerade (Post 486163)
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 :D

Look on how the CRCPage was created. This should guide you in the right direction :p


All times are GMT -7. The time now is 06:39.

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