Implementing event functions InitializeWizard while using ISSI (to add background image) in Inno Setup:...












1















I'm trying to put a background image to Inno Setup installer using ISSI along with a song using the "BASS audio library", but I can only keep one of them active since I get this compiler error:




Duplicate identifier 'INITIALIZEWIZARD'




Would I have another way to get a full-screen background image so I can use the BASS audio library?



Inno Setup code:



; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define ISSI_BackgroundImage "E:Instaladorfile.bmp"

#define ISSI_BackgroundImage_BGColor "clWhite"

#define ISSI_IncludePath "C:ISSI"
#include ISSI_IncludePath+"_issi.isi"

[Files]
Source: "Bass.dll"; Flags: dontcopy
Source: "AudioFile.mp3"; Flags: dontcopy

[Code]
const
BASS_SAMPLE_LOOP = 4;
BASS_UNICODE = $80000000;
BASS_CONFIG_GVOL_STREAM = 5;
const
#ifndef UNICODE
EncodingFlag = 0;
#else
EncodingFlag = BASS_UNICODE;
#endif
type
HSTREAM = DWORD;

function BASS_Init(device: LongInt; freq, flags: DWORD;
win: HWND; clsid: Cardinal): BOOL;
external 'BASS_Init@files:bass.dll stdcall';
function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
external 'BASS_StreamCreateFile@files:bass.dll stdcall';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
external 'BASS_ChannelPlay@files:bass.dll stdcall';
function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
external 'BASS_SetConfig@files:bass.dll stdcall';
function BASS_Free: BOOL;
external 'BASS_Free@files:bass.dll stdcall';

procedure InitializeWizard;
var
StreamHandle: HSTREAM;
begin
ExtractTemporaryFile('AudioFile.mp3');
if BASS_Init(-1, 44100, 0, 0, 0) then
begin
StreamHandle := BASS_StreamCreateFile(False,
ExpandConstant('{tmp}AudioFile.mp3'), 0, 0, 0, 0,
EncodingFlag or BASS_SAMPLE_LOOP);
BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
BASS_ChannelPlay(StreamHandle, False);
end;
end;

procedure DeinitializeSetup;
begin
BASS_Free;
end;


Who can help me, I'm really grateful.










share|improve this question





























    1















    I'm trying to put a background image to Inno Setup installer using ISSI along with a song using the "BASS audio library", but I can only keep one of them active since I get this compiler error:




    Duplicate identifier 'INITIALIZEWIZARD'




    Would I have another way to get a full-screen background image so I can use the BASS audio library?



    Inno Setup code:



    ; Script generated by the Inno Setup Script Wizard.
    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

    #define ISSI_BackgroundImage "E:Instaladorfile.bmp"

    #define ISSI_BackgroundImage_BGColor "clWhite"

    #define ISSI_IncludePath "C:ISSI"
    #include ISSI_IncludePath+"_issi.isi"

    [Files]
    Source: "Bass.dll"; Flags: dontcopy
    Source: "AudioFile.mp3"; Flags: dontcopy

    [Code]
    const
    BASS_SAMPLE_LOOP = 4;
    BASS_UNICODE = $80000000;
    BASS_CONFIG_GVOL_STREAM = 5;
    const
    #ifndef UNICODE
    EncodingFlag = 0;
    #else
    EncodingFlag = BASS_UNICODE;
    #endif
    type
    HSTREAM = DWORD;

    function BASS_Init(device: LongInt; freq, flags: DWORD;
    win: HWND; clsid: Cardinal): BOOL;
    external 'BASS_Init@files:bass.dll stdcall';
    function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
    offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
    external 'BASS_StreamCreateFile@files:bass.dll stdcall';
    function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
    external 'BASS_ChannelPlay@files:bass.dll stdcall';
    function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
    external 'BASS_SetConfig@files:bass.dll stdcall';
    function BASS_Free: BOOL;
    external 'BASS_Free@files:bass.dll stdcall';

    procedure InitializeWizard;
    var
    StreamHandle: HSTREAM;
    begin
    ExtractTemporaryFile('AudioFile.mp3');
    if BASS_Init(-1, 44100, 0, 0, 0) then
    begin
    StreamHandle := BASS_StreamCreateFile(False,
    ExpandConstant('{tmp}AudioFile.mp3'), 0, 0, 0, 0,
    EncodingFlag or BASS_SAMPLE_LOOP);
    BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
    BASS_ChannelPlay(StreamHandle, False);
    end;
    end;

    procedure DeinitializeSetup;
    begin
    BASS_Free;
    end;


    Who can help me, I'm really grateful.










    share|improve this question



























      1












      1








      1


      1






      I'm trying to put a background image to Inno Setup installer using ISSI along with a song using the "BASS audio library", but I can only keep one of them active since I get this compiler error:




      Duplicate identifier 'INITIALIZEWIZARD'




      Would I have another way to get a full-screen background image so I can use the BASS audio library?



      Inno Setup code:



      ; Script generated by the Inno Setup Script Wizard.
      ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

      #define ISSI_BackgroundImage "E:Instaladorfile.bmp"

      #define ISSI_BackgroundImage_BGColor "clWhite"

      #define ISSI_IncludePath "C:ISSI"
      #include ISSI_IncludePath+"_issi.isi"

      [Files]
      Source: "Bass.dll"; Flags: dontcopy
      Source: "AudioFile.mp3"; Flags: dontcopy

      [Code]
      const
      BASS_SAMPLE_LOOP = 4;
      BASS_UNICODE = $80000000;
      BASS_CONFIG_GVOL_STREAM = 5;
      const
      #ifndef UNICODE
      EncodingFlag = 0;
      #else
      EncodingFlag = BASS_UNICODE;
      #endif
      type
      HSTREAM = DWORD;

      function BASS_Init(device: LongInt; freq, flags: DWORD;
      win: HWND; clsid: Cardinal): BOOL;
      external 'BASS_Init@files:bass.dll stdcall';
      function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
      offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
      external 'BASS_StreamCreateFile@files:bass.dll stdcall';
      function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
      external 'BASS_ChannelPlay@files:bass.dll stdcall';
      function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
      external 'BASS_SetConfig@files:bass.dll stdcall';
      function BASS_Free: BOOL;
      external 'BASS_Free@files:bass.dll stdcall';

      procedure InitializeWizard;
      var
      StreamHandle: HSTREAM;
      begin
      ExtractTemporaryFile('AudioFile.mp3');
      if BASS_Init(-1, 44100, 0, 0, 0) then
      begin
      StreamHandle := BASS_StreamCreateFile(False,
      ExpandConstant('{tmp}AudioFile.mp3'), 0, 0, 0, 0,
      EncodingFlag or BASS_SAMPLE_LOOP);
      BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
      BASS_ChannelPlay(StreamHandle, False);
      end;
      end;

      procedure DeinitializeSetup;
      begin
      BASS_Free;
      end;


      Who can help me, I'm really grateful.










      share|improve this question
















      I'm trying to put a background image to Inno Setup installer using ISSI along with a song using the "BASS audio library", but I can only keep one of them active since I get this compiler error:




      Duplicate identifier 'INITIALIZEWIZARD'




      Would I have another way to get a full-screen background image so I can use the BASS audio library?



      Inno Setup code:



      ; Script generated by the Inno Setup Script Wizard.
      ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

      #define ISSI_BackgroundImage "E:Instaladorfile.bmp"

      #define ISSI_BackgroundImage_BGColor "clWhite"

      #define ISSI_IncludePath "C:ISSI"
      #include ISSI_IncludePath+"_issi.isi"

      [Files]
      Source: "Bass.dll"; Flags: dontcopy
      Source: "AudioFile.mp3"; Flags: dontcopy

      [Code]
      const
      BASS_SAMPLE_LOOP = 4;
      BASS_UNICODE = $80000000;
      BASS_CONFIG_GVOL_STREAM = 5;
      const
      #ifndef UNICODE
      EncodingFlag = 0;
      #else
      EncodingFlag = BASS_UNICODE;
      #endif
      type
      HSTREAM = DWORD;

      function BASS_Init(device: LongInt; freq, flags: DWORD;
      win: HWND; clsid: Cardinal): BOOL;
      external 'BASS_Init@files:bass.dll stdcall';
      function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
      offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
      external 'BASS_StreamCreateFile@files:bass.dll stdcall';
      function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
      external 'BASS_ChannelPlay@files:bass.dll stdcall';
      function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
      external 'BASS_SetConfig@files:bass.dll stdcall';
      function BASS_Free: BOOL;
      external 'BASS_Free@files:bass.dll stdcall';

      procedure InitializeWizard;
      var
      StreamHandle: HSTREAM;
      begin
      ExtractTemporaryFile('AudioFile.mp3');
      if BASS_Init(-1, 44100, 0, 0, 0) then
      begin
      StreamHandle := BASS_StreamCreateFile(False,
      ExpandConstant('{tmp}AudioFile.mp3'), 0, 0, 0, 0,
      EncodingFlag or BASS_SAMPLE_LOOP);
      BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
      BASS_ChannelPlay(StreamHandle, False);
      end;
      end;

      procedure DeinitializeSetup;
      begin
      BASS_Free;
      end;


      Who can help me, I'm really grateful.







      inno-setup pascalscript bass






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 6 '18 at 7:05









      Martin Prikryl

      88.1k22173376




      88.1k22173376










      asked Nov 22 '18 at 2:27









      空のYe Falls空のYe Falls

      82




      82
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Inno Setup Script #Includes (ISSI) may implement some Inno Setup event functions, like InitializeWizard, InitializeSetup, CurPageChanged, BackButtonClick, NextButtonClick and DeinitializeSetup for its own purposes. Not all event functions are necessarily defined, it depends on ISSI features you are using. In your case, it's the ISSI_BackgroundImage that causes implementation of InitializeWizard event function.



          If you need to run your own code in some of these event functions, ISSI implementation of event function can call your user defined function, when you define an appropriate preprocessor symbol. The symbol name is like ISSI_EventFunctionName and the user defined function must have the same name. The function/procedure also must have the same signature as the original Inno Setup event function.



          Both the symbol and the user function must be defined before you include _issi.isi.



          An example for InitializeWizard:



          [Code]

          procedure ISSI_InitializeWizard;
          begin
          { Your BASS code goes here }
          end;

          #define ISSI_InitializeWizard

          #define ISSI_IncludePath "C:ISSI"
          #include ISSI_IncludePath+"_issi.isi"





          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423064%2fimplementing-event-functions-initializewizard-while-using-issi-to-add-backgroun%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Inno Setup Script #Includes (ISSI) may implement some Inno Setup event functions, like InitializeWizard, InitializeSetup, CurPageChanged, BackButtonClick, NextButtonClick and DeinitializeSetup for its own purposes. Not all event functions are necessarily defined, it depends on ISSI features you are using. In your case, it's the ISSI_BackgroundImage that causes implementation of InitializeWizard event function.



            If you need to run your own code in some of these event functions, ISSI implementation of event function can call your user defined function, when you define an appropriate preprocessor symbol. The symbol name is like ISSI_EventFunctionName and the user defined function must have the same name. The function/procedure also must have the same signature as the original Inno Setup event function.



            Both the symbol and the user function must be defined before you include _issi.isi.



            An example for InitializeWizard:



            [Code]

            procedure ISSI_InitializeWizard;
            begin
            { Your BASS code goes here }
            end;

            #define ISSI_InitializeWizard

            #define ISSI_IncludePath "C:ISSI"
            #include ISSI_IncludePath+"_issi.isi"





            share|improve this answer






























              0














              Inno Setup Script #Includes (ISSI) may implement some Inno Setup event functions, like InitializeWizard, InitializeSetup, CurPageChanged, BackButtonClick, NextButtonClick and DeinitializeSetup for its own purposes. Not all event functions are necessarily defined, it depends on ISSI features you are using. In your case, it's the ISSI_BackgroundImage that causes implementation of InitializeWizard event function.



              If you need to run your own code in some of these event functions, ISSI implementation of event function can call your user defined function, when you define an appropriate preprocessor symbol. The symbol name is like ISSI_EventFunctionName and the user defined function must have the same name. The function/procedure also must have the same signature as the original Inno Setup event function.



              Both the symbol and the user function must be defined before you include _issi.isi.



              An example for InitializeWizard:



              [Code]

              procedure ISSI_InitializeWizard;
              begin
              { Your BASS code goes here }
              end;

              #define ISSI_InitializeWizard

              #define ISSI_IncludePath "C:ISSI"
              #include ISSI_IncludePath+"_issi.isi"





              share|improve this answer




























                0












                0








                0







                Inno Setup Script #Includes (ISSI) may implement some Inno Setup event functions, like InitializeWizard, InitializeSetup, CurPageChanged, BackButtonClick, NextButtonClick and DeinitializeSetup for its own purposes. Not all event functions are necessarily defined, it depends on ISSI features you are using. In your case, it's the ISSI_BackgroundImage that causes implementation of InitializeWizard event function.



                If you need to run your own code in some of these event functions, ISSI implementation of event function can call your user defined function, when you define an appropriate preprocessor symbol. The symbol name is like ISSI_EventFunctionName and the user defined function must have the same name. The function/procedure also must have the same signature as the original Inno Setup event function.



                Both the symbol and the user function must be defined before you include _issi.isi.



                An example for InitializeWizard:



                [Code]

                procedure ISSI_InitializeWizard;
                begin
                { Your BASS code goes here }
                end;

                #define ISSI_InitializeWizard

                #define ISSI_IncludePath "C:ISSI"
                #include ISSI_IncludePath+"_issi.isi"





                share|improve this answer















                Inno Setup Script #Includes (ISSI) may implement some Inno Setup event functions, like InitializeWizard, InitializeSetup, CurPageChanged, BackButtonClick, NextButtonClick and DeinitializeSetup for its own purposes. Not all event functions are necessarily defined, it depends on ISSI features you are using. In your case, it's the ISSI_BackgroundImage that causes implementation of InitializeWizard event function.



                If you need to run your own code in some of these event functions, ISSI implementation of event function can call your user defined function, when you define an appropriate preprocessor symbol. The symbol name is like ISSI_EventFunctionName and the user defined function must have the same name. The function/procedure also must have the same signature as the original Inno Setup event function.



                Both the symbol and the user function must be defined before you include _issi.isi.



                An example for InitializeWizard:



                [Code]

                procedure ISSI_InitializeWizard;
                begin
                { Your BASS code goes here }
                end;

                #define ISSI_InitializeWizard

                #define ISSI_IncludePath "C:ISSI"
                #include ISSI_IncludePath+"_issi.isi"






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 22 '18 at 12:01

























                answered Nov 22 '18 at 7:30









                Martin PrikrylMartin Prikryl

                88.1k22173376




                88.1k22173376
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53423064%2fimplementing-event-functions-initializewizard-while-using-issi-to-add-backgroun%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    If I really need a card on my start hand, how many mulligans make sense? [duplicate]

                    Alcedinidae

                    Can an atomic nucleus contain both particles and antiparticles? [duplicate]