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

Reply
 
Thread Tools Display Modes
  #1381  
Old 24-04-2020, 10:10
DiCaPrIo DiCaPrIo is offline
Registered User
 
Join Date: Apr 2017
Location: Don't Know
Posts: 50
Thanks: 90
Thanked 49 Times in 30 Posts
DiCaPrIo is on a distinguished road
try it it might delete
Quote:
[UninstallDelete]
Type: FilesAndOrDirs; Name: {app}
Type: Files; Name: {code:GetIconDir}
#define IconName ReadIni(SourcePath + "\Settings.ini", "Executable", "ExeName", "")

[Code]
function GetIconDir(Value:String):string;
begin
Result:=ExpandConstant('{commonstartmenu}\{#IconNa me}.lnk')
end;
Reply With Quote
The Following User Says Thank You to DiCaPrIo For This Useful Post:
KaktoR (24-04-2020)
Sponsored Links
  #1382  
Old 24-04-2020, 11:09
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 3,555
Thanks: 935
Thanked 5,799 Times in 2,140 Posts
KaktoR is on a distinguished road
Thanks. Will look into this later

Edit: It works but only for one icon (not for both). Not very smart because I have to create functions for both desktop and group icons ^^

However, I just did it this way until I find a better way

Code:
[UninstallDelete]
Type: files; Name: {userdesktop}\{#Shortcut1Name}.lnk
Type: files; Name: {userstartmenu}\{#Name}\{#Shortcut2Name}.lnk
__________________
Haters gonna hate

Last edited by KaktoR; 24-04-2020 at 14:59.
Reply With Quote
  #1383  
Old 24-04-2020, 16:21
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 776
Thanks: 1,289
Thanked 1,641 Times in 559 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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;

Last edited by Cesar82; 24-04-2020 at 16:25.
Reply With Quote
  #1384  
Old 24-04-2020, 16:26
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 3,555
Thanks: 935
Thanked 5,799 Times in 2,140 Posts
KaktoR is on a distinguished road
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 View Post
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.
__________________
Haters gonna hate
Reply With Quote
  #1385  
Old 24-04-2020, 17:12
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 776
Thanks: 1,289
Thanked 1,641 Times in 559 Posts
Cesar82 is on a distinguished road
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
Attached Files
File Type: rar icons_ISPP.rar (745 Bytes, 4 views)
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
KaktoR (27-04-2020)
  #1386  
Old 27-04-2020, 11:50
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 3,555
Thanks: 935
Thanked 5,799 Times in 2,140 Posts
KaktoR is on a distinguished road
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}
__________________
Haters gonna hate
Reply With Quote
  #1387  
Old 27-04-2020, 16:31
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 776
Thanks: 1,289
Thanked 1,641 Times in 559 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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.
Attached Files
File Type: 7z Shortcuts ISPP.7z (1.0 KB, 5 views)

Last edited by Cesar82; 28-04-2020 at 03:23.
Reply With Quote
The Following User Says Thank You to Cesar82 For This Useful Post:
KaktoR (28-04-2020)
  #1388  
Old 28-04-2020, 05:26
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 3,555
Thanks: 935
Thanked 5,799 Times in 2,140 Posts
KaktoR is on a distinguished road
Thanks, this works fine.

I just don't understand all of this ispp things... Will read about it some more.
__________________
Haters gonna hate
Reply With Quote
  #1389  
Old 28-04-2020, 05:55
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 776
Thanks: 1,289
Thanked 1,641 Times in 559 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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.
Reply With Quote
  #1390  
Old 25-05-2020, 10:54
doofoo24 doofoo24 is offline
Registered User
 
Join Date: Nov 2016
Location: canada
Posts: 408
Thanks: 138
Thanked 459 Times in 227 Posts
doofoo24 is on a distinguished road
does the new inno 6.0.5 have Dark theme built-in ?
Reply With Quote
  #1391  
Old 02-06-2020, 05:33
Masquerade's Avatar
Masquerade Masquerade is online now
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 730
Thanks: 160
Thanked 761 Times in 382 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
  #1392  
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)
  #1393  
Old 02-06-2020, 07:07
Masquerade's Avatar
Masquerade Masquerade is online now
Registered User
 
Join Date: Jan 2020
Location: Monte d'Or
Posts: 730
Thanks: 160
Thanked 761 Times in 382 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
  #1394  
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
  #1395  
Old 02-06-2020, 16:04
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 776
Thanks: 1,289
Thanked 1,641 Times in 559 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)
Reply

Thread Tools
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 23:20.


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