Error: Missing closing quote on parameter "Name" - inno-setup

At compile time, Inno keeps saying there was an error:
Line: 81
Error: Missing closing quote on parameter "Name"
but I don't see anything wrong. It points to the line just below [icons]
[Files]
Source: "{#SOURCEDIR}\Debug\myapplication.exe"; DestDir: {app}; Flags: ignoreversion
Source: "{#SOURCEDIR}\Debug\aDllFile.dll"; DestDir: {app}; Flags: ignoreversion
Source: "{#SOURCEDIR}\Debug\another.aDllFile.dll"; DestDir: {app}; Flags: ignoreversion
Source: "{#SOURCEDIR}\Debug\and.another.aDllFile.dll"; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#APPTITLE}"; Filename: "{app}\{#APPEXENAME}"
Name: "{group}\{cm:ProgramOnTheWeb,{#APPTITLE}}"; Filename: "{#APPURL}"
Name: "{group}\{cm:UninstallProgram,{#APPTITLE}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#APPTITLE}"; Filename: "{app}\{#APPEXENAME}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#APPTITLE}"; Filename: "{app}\{#APPEXENAME}"; Tasks: quicklaunchicon
Name: "{userstartup}\{#APPTITLE}"; Filename: "{app}\{#APPEXENAME}"; IconFilename: "{app}\{#APPEXENAME}";
[Run]
;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, ""&"", ""&&"")}}"; Flags: nowait RunHidden SkipIfDoesntExist; Parameters: exit; WorkingDir: {app};
Filename: {app}\{#APPEXENAME}; Description: "{cm:LaunchProgram,{#StringChange(APPNAME, "noupdate", "&&")}}"; Flags: nowait postinstall skipifsilent
[Messages]
WelcomeLabel1=Welcome to the Setup Wizard for%n[name]
WelcomeLabel2=Salve! This application will install [name/ver] on your computer. You do not need administrator rights to do this.%n%nIf you would close your other applications before continuing, it would be mighty nice of you.
ExitSetupMessage=Hey! I'm not finished installing!%n If you exit now, the program will not be installed.%n%nHowever, you can always run the Setup again some other time if you wish to complete the installation.%n%nDo you still want to exit?
InfoBeforeLabel=Just a few little notes about {#APPTITLE}...
InfoBeforeClickLabel=When you are ready to continue the Installation, just click Next.
SelectTasksDesc=Just a few little tidbits, if you like them...
[note]
I can't believe this question was viewed 1003 times and noone gave me a vote!

Okay, I figured it out. One of my definitions was failing. It was supposed to extract the file_description from the target executable's resource.
#define APPTITLE GetStringFileInfo("C:\sourcepath\myapplication.exe", FILE_DESCRIPTION)
There was a ' in the File Description! And that caused Inno to offest all of its quotation marks.
Here is what Dee Earley at the Inno forum told me:
Why should it escape it? It doesn't know what it needs to escape it for, it's "just a string". You should escape it for it's output when needed using StringChange() or just quoting it properly. '

Related

Using regasm with AnyCPU DLL for both 32 bit and 64 bit using Inno Setup

I have a C# COM DLL that has been compiled with the setting Any CPU.
At the moment I have put this into the script:
[Run]
Filename: "{dotnet40}\regasm.exe"; Parameters: "MSAToolsGMailClassLibrary.dll /codebase"; WorkingDir: "{app}"; Flags: runhidden
Filename: "{dotnet4064}\regasm.exe"; Parameters: "MSAToolsGMailClassLibrary.dll /codebase"; WorkingDir: "{app}"; Flags: runhidden; Check: IsWin64
[UninstallRun]
Filename: {dotnet40}\regasm.exe; Parameters: /u MSAToolsGMailClassLibrary.dll; WorkingDir: {app}; Flags: runhidden
Filename: {dotnet4064}\regasm.exe; Parameters: /u MSAToolsGMailClassLibrary.dll; WorkingDir: {app}; Flags: runhidden; Check: IsWin64;
Since there is only one file (but my installer installs my application in both 32 bit and 64 bit) have I done the right thing here by putting it twice?

Inno setup - allowing database modification

my application includes a db and users will be able to add data to the db via a GUI. So I need to give authorization to the user to modify the db. I tried all options from this post but authorization is still not allowed.
Here, this is an illustration of what I try to achieve (get Permissions for Modify checked in the "Allow" column):
Here my current code:
#define MyAppName "aaa"
#define MyAppVersion "1.0"
#define MyAppExeName "aaa.exe"
[Setup]
AppId={{...-...-...-...-...}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\...\output
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Dirs]
Name: "{app}\Logs"; Permissions: everyone-modify
[Files]
Source: "C:\...\aaa.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\list_files\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-modify
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
How can I give database access to the user through the creation process of the setup? Thank you
[Files]
Source: "C:\...\aaa.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\folder_files\*"; DestDir: "{localappdata}\name_application\folder_files\"; Flags: ignoreversion recursesubdirs createallsubdirs

Use both 32-bit and 64-bit version of rundll32.exe in Inno Setup

I want to convert theses two lines that I have in a batch file to Inno Setup [Run] section:
%windir%\SysWOW64\rundll32.exe "%~dp0my32.dll",RegDll
%windir%\system32\rundll32.exe "%~dp0my64.dll",RegDll
So I want something like this (but working):
[Run]
Filename: "{sys}\rundll32.exe"; Parameters: ""{code:GetDir|0}\my64.dll",RegDll"; WorkingDir: "{code:GetDir|0}"; StatusMsg: "Registering Module..."; MinVersion: 0.0,5.0; Flags: runhidden runascurrentuser
Filename: "{syswow64}\rundll32.exe"; Parameters: ""{code:GetDir|0}\my32.dll",RegDll"; WorkingDir: "{code:GetDir|0}"; StatusMsg: "Registering Module..."; MinVersion: 0.0,5.0; Flags: runhidden runascurrentuser
Your code is correct in 64-bit install mode, i.e. if you have ArchitecturesInstallIn64BitMode set:
[Setup]
ArchitecturesInstallIn64BitMode=x64
In 32-bit install mode, Inno Setup, being 32-bit application, will get redirected to C:\WINDOWS\SysWOW64, when it tries to access C:\Windows\System32. So effectively, both sys and syswow64 map to the same [32-bit] folder (C:\WINDOWS\SysWOW64).
You can override that (if you do not want to switch to 64-bit install mode) by using 64bit flag:
[Run]
Filename: "{sys}\rundll32.exe"; Parameters: """{code:GetDir|0}\my64.dll"",RegDll"; \
WorkingDir: "{code:GetDir|0}"; StatusMsg: "Registering Module..."; \
MinVersion: 0.0,5.0; Flags: runhidden runascurrentuser; Flags: 64bit;
Filename: "{sys}\rundll32.exe"; Parameters: """{code:GetDir|0}\my32.dll"",RegDll"; \
WorkingDir: "{code:GetDir|0}"; StatusMsg: "Registering Module..."; \
MinVersion: 0.0,5.0; Flags: runhidden runascurrentuser; Flags: 32bit;

Deleting and unregistering DLL files during install using Inno Setup

In my [Files] section I have the following:
; Database password decryption (for PTS importing)
Source: "..\..\..\PTSTools\PTSTools\bin\x86\Release\PTSTools.dll"; \
DestDir: "{app}"; \
DestName: "PTSTools_x86.dll"; Flags: ignoreversion
Source: "..\..\..\PTSTools\PTSTools\bin\x64\Release\PTSTools.dll"; \
DestDir: "{app}"; \
DestName: "PTSTools_x64.dll"; Flags: ignoreversion; Check: IsWin64
In the [Run] section I have:
Filename: "{dotnet40}\regasm.exe"; Parameters: "PTSTools_x86.dll /codebase"; \
WorkingDir: "{app}"; Flags: runhidden
Filename: "{dotnet4064}\regasm.exe"; Parameters: "PTSTools_x64.dll /codebase"; \
WorkingDir: "{app}"; Flags: runhidden; Check: IsWin64
Finally, in the [UninstallRun] section I have:
Filename: {dotnet40}\regasm.exe; Parameters: /u PTSTools_x86.dll; \
WorkingDir: {app}; \
Flags: runhidden
Filename: {dotnet4064}\regasm.exe; Parameters: /u PTSTools_x64.dll; \
WorkingDir: {app}; \
Flags: runhidden; Check: IsWin64;
Now, in this version of my program I have consolidated the functionality of these two DLL files into another set of DLL files:
Source: "..\..\..\MSAToolsLibrary\MSAToolsLibrary\bin\x86\Release\MSAToolsLibrary.dll"; \
DestDir: "{app}"; DestName: "MSAToolsLibrary_x86.dll"; Flags: ignoreversion
Source: "..\..\..\MSAToolsLibrary\MSAToolsLibrary\bin\x64\Release\MSAToolsLibrary.dll"; \
DestDir: "{app}"; DestName: "MSAToolsLibrary_x64.dll"; Flags: ignoreversion; \
Check: IsWin64
As a result, the PTSTool DLL files are no longer required. Now, I know I can simply delete them if they exist:
[InstallDelete]
Type: files; Name: "{app}\PTSTools_x64.dll"
Type: files; Name: "{app}\PTSTools_x86.dll"
But as far as I am aware this will not trigger the unregistering of the DLL files as is done in [UninstallRun].
How can I do this? Delete and unregister the DLL files (if they exist) during the install?
I do not think you can implement this easily using the standard sections.
A [Run] entry happens only after [InstallDelete]. While you need it the other way around to first unregister, before you delete a DLL.
So you need Pascal scripting.
Either add BeforeInstall parameter to [InstallDelete] and unregister the DLL programmaticaly.
Or add AfterInstall parameter to [Run] and delete the DLL programmatically.
The latter is less work for you, as you already know how to use [Run] to (un)register.
[Run]
Filename: {dotnet40}\regasm.exe; Parameters: /u PTSTools_x86.dll; \
WorkingDir: {app}; \
Check: FileExists(ExpandConstant('{app}\PTSTools_x86.dll')); \
AfterInstall: DoDeleteFile(ExpandConstant('{app}\PTSTools_x86.dll')); \
Flags: runhidden
Filename: {dotnet4064}\regasm.exe; Parameters: /u PTSTools_x64.dll; \
WorkingDir: {app}; \
Check: IsWin64 and FileExists(ExpandConstant('{app}\PTSTools_x64.dll')); \
AfterInstall: DoDeleteFile(ExpandConstant('{app}\PTSTools_x64.dll')); \
Flags: runhidden
[Code]
{ Cannot use built-in DeleteFile directly in AfterInstall as it's a function,
{ not a procedure. And this way we can add some error handling too. }
procedure DoDeleteFile(FileName: string);
begin
if DeleteFile(FileName) then
begin
Log(Format('"%s" deleted', [FileName]));
end
else
begin
MsgBox(Format('Failed to delete "%s"', [FileName]), mbError, MB_OK);
end;
end;

Update application with Inno Setup installer

I am learning how to use Inno Setup to create an installer for my project. I am having an issue though when it comes to updating. I've created the installer, and installed my application successfully. I've then updated my version number within the script and recompiled however when I run the installer it seems to treat it as a new install still.
For example, it will ask me where I want the application to be installed and when I click next then tells me the directory already exists. As the application has already been installed. I expected this bit to be skipped.
Below is my InnoSetup Script
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "SQLite Manager"
#define MyAppVersion "1.0.0.2"
#define MyAppPublisher "Boardies IT Solutions"
#define MyAppURL "http://www.boardiesitsolutions.com"
#define MyAppExeName "SqliteManager.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{98A016AD-2DE2-4FF9-B639-0FDCA0BE41FD}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Boardies IT Solutions\{#MyAppName}
DefaultGroupName=Boardies IT Solutions
LicenseFile=C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\Terms.txt
OutputBaseFilename=sqliteman
SetupIconFile=C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\Logo.ico
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=yes
CreateUninstallRegKey=no
UpdateUninstallLogAppName=no
DisableDirPage=auto
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
[Files]
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\SqliteManager.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\BoardiesITSolutions.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\BoardiesITSolutions.INIReader.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\changelog.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\EntityFramework.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\EntityFramework.SqlServer.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\Middleware.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\MySql.Data.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\System.Data.SQLite.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\System.Data.SQLite.EF6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\System.Data.SQLite.Linq.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Chris\Documents\Visual Studio 2013\Projects\SqliteManager\SqliteManager\bin\Debug\WhatsNew.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
I've noticed that little detail
AppId={{98A016AD-2DE2-4FF9-B639-0FDCA0BE41FD}
Looks like you have a missing right curly brace.

Resources